Skip to content

Commit

Permalink
Core test.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Jan 9, 2024
1 parent a4408d4 commit 04c8c5a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/IKVM.Reflection.Tests/ModuleWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,30 @@ public class ModuleWriterTests
[TestMethod]
public void CanWriteNetFxModule()
{
var d = Path.Combine(TestContext.TestRunResultsDirectory, "IKVK.Reflection.Tests", "ModuleWriterTests");
var d = Path.Combine(TestContext.TestRunResultsDirectory, "IKVM.Reflection.Tests", "ModuleWriterTests");
if (Directory.Exists(d))
Directory.Delete(d, true);
Directory.CreateDirectory(d);

var u = new Universe("mscorlib");
var a = u.DefineDynamicAssembly(new AssemblyName("Test"), AssemblyBuilderAccess.Save, d);
var m = a.DefineDynamicModule("Test", "Test.dll", false);
m.DefineType("Type");
a.Save("Test.dll");
}

[TestMethod]
public void CanWriteNetCoreModule()
{
var d = Path.Combine(TestContext.TestRunResultsDirectory, "IKVM.Reflection.Tests", "ModuleWriterTests");
if (Directory.Exists(d))
Directory.Delete(d, true);
Directory.CreateDirectory(d);

var u = new Universe("System.Runtime");
var a = u.DefineDynamicAssembly(new AssemblyName("Test"), AssemblyBuilderAccess.Save, d);
var m = a.DefineDynamicModule("Test", "Test.dll", false);
m.DefineType("Type");
a.Save("Test.dll");
}

Expand Down

0 comments on commit 04c8c5a

Please sign in to comment.