Skip to content

Instantly share code, notes, and snippets.

@DevJohnC
Created November 13, 2014 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DevJohnC/caced52032461d294ce9 to your computer and use it in GitHub Desktop.
Save DevJohnC/caced52032461d294ce9 to your computer and use it in GitHub Desktop.
IKVM Reflection test
/// <summary>
/// Tests that the ManifestReader isn't loading assemblies.
/// </summary>
[TestMethod]
public void ManifestReaderDoesntLoadAssemblies()
{
var didFail = false;
AppDomain.CurrentDomain.AssemblyLoad += (sender, args) =>
{
if (args.LoadedAssembly.FullName.IndexOf("SimplePlugin") != -1)
didFail = true;
};
var reader = new ManifestReader("../../../../ExamplePlugins/SimplePlugin/bin/Debug/SimplePlugin.dll");
var manifest = reader.ReadManifestAttribute();
if (didFail)
Assert.Fail("ManifestReader caused an assembly to load.");
if (manifest == null)
Assert.Fail("Failed to read manifest.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment