public void TestDeclaringTypeProperty()
 {
     CreateCallee();
     _myEnumBuilder = _myModuleBuilder.DefineEnum("myEnum", TypeAttributes.Public, typeof(int));
     _myEnumBuilder.AsType();
     Type myDeclaringType = _myEnumBuilder.DeclaringType;
     Assert.Null(myDeclaringType);
 }
Esempio n. 2
0
 public void TestBaseTypeProperty()
 {
     CreateCallee();
     _myEnumBuilder = _myModuleBuilder.DefineEnum("myEnum", TypeAttributes.Public, typeof(int));
     _myEnumBuilder.AsType();
     Type myBaseType = _myEnumBuilder.BaseType;
     Assert.Equal(typeof(Enum), myBaseType);
 }
Esempio n. 3
0
 public void TestFullNameProperty()
 {
     CreateCallee();
     _myEnumBuilder = _myModuleBuilder.DefineEnum("myEnum", TypeAttributes.Public, typeof(int));
     _myEnumBuilder.AsType();
     string myFullName = _myEnumBuilder.FullName;
     Assert.Equal(_myEnumBuilder.FullName, myFullName);
 }
Esempio n. 4
0
 public void TestNamespaceProperty()
 {
     CreateCallee();
     _myEnumBuilder = _myModuleBuilder.DefineEnum("myEnum", TypeAttributes.Public, typeof(int));
     _myEnumBuilder.AsType();
     string myEnumNamespace = _myEnumBuilder.Namespace;
     Assert.Equal("", myEnumNamespace);
 }
Esempio n. 5
0
 public void PosTest1()
 {
     CreateCallee();
     _myEnumBuilder = _myModuleBuilder.DefineEnum("myEnum", TypeAttributes.Public, typeof(int));
     _myEnumBuilder.AsType();
     Assembly myAssem = _myEnumBuilder.Assembly;
     Assert.Equal(_myAssemblyBuilder.FullName, myAssem.FullName);
 }
Esempio n. 6
0
 public void TestModuleProperty()
 {
     CreateCallee();
     _myEnumBuilder = _myModuleBuilder.DefineEnum("myEnum", TypeAttributes.Public, typeof(int));
     _myEnumBuilder.AsType();
     Module myModule = _myEnumBuilder.Module;
     Assert.True(myModule.Equals(_myModuleBuilder));
 }
 public void TestDefineLiteral()
 {
     CreateCallee();
     _myEnumBuilder = _myModuleBuilder.DefineEnum("myEnum", TypeAttributes.Public, typeof(int));
     FieldBuilder myField = _myEnumBuilder.DefineLiteral("FieldOne", 1);
     _myEnumBuilder.AsType();
     Assert.True(myField.IsLiteral);
     Assert.True(myField.IsPublic);
     Assert.True(myField.IsStatic);
 }