Exemplo n.º 1
0
 public void CreateEnum()
 {
     Utilities.Reflection.Emit.Assembly    TestObject = new Utilities.Reflection.Emit.Assembly("TestingThis");
     Utilities.Reflection.Emit.EnumBuilder EnumObject = TestObject.CreateEnum("TestEnum");
     Assert.NotNull(EnumObject);
     Assert.DoesNotThrow(() => TestObject.Create());
 }
Exemplo n.º 2
0
 public void AddLiteral()
 {
     Utilities.Reflection.Emit.Assembly    Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly");
     Utilities.Reflection.Emit.EnumBuilder Enum     = Assembly.CreateEnum("TestEnum");
     Enum.AddLiteral("TestLiteral1", 1);
     Enum.AddLiteral("TestLiteral2", 2);
     Assembly.Create();
     Assert.NotNull(Activator.CreateInstance(Enum.DefinedType));
 }