public void GetDefinition() { Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly"); Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType"); Utilities.Reflection.Emit.Interfaces.IPropertyBuilder Property = TestType.CreateDefaultProperty("Property1", typeof(int)); Assert.NotEmpty(Property.GetDefinition()); }
public void Create() { Utilities.Reflection.Emit.Assembly Assembly = new Utilities.Reflection.Emit.Assembly("TestAssembly"); Utilities.Reflection.Emit.TypeBuilder TestType = Assembly.CreateType("TestType"); Utilities.Reflection.Emit.Interfaces.IPropertyBuilder Property = TestType.CreateDefaultProperty("Property1", typeof(int)); Assert.NotNull(Property); Assert.Equal(typeof(int), Property.DataType); Assert.Equal("Property1", Property.Name); Assert.Equal(PropertyAttributes.SpecialName, Property.Attributes); Assert.NotNull(Property.GetMethod); Assert.Equal(MethodAttributes.Public | MethodAttributes.Virtual, Property.GetMethodAttributes); Assert.NotNull(Property.SetMethod); Assert.Equal(MethodAttributes.Public | MethodAttributes.Virtual, Property.SetMethodAttributes); Assert.NotNull(Property.Builder); }