public void ShouldCheckIfTypeAlreadyExists() { Dictionary <string, Type> typeDef = new Dictionary <string, Type> { { "StringProp", typeof(String) }, { "IntProp", typeof(int) }, { "DateProp", typeof(DateTime) }, { "DoubleNullableProp", typeof(double?) } }; Type t = TypeGenerator.MakeType("TestClassA", typeDef); Assert.That(t, Is.Not.Null); Type t2 = TypeGenerator.GetType("TestClassA"); Assert.That(t2, Is.Not.Null); Assert.Throws <ArgumentException>(() => TypeGenerator.MakeType("TestClassA", typeDef)); Assert.That(t2, Is.EqualTo(t)); }
public override Type ResolveType() { return(TypeGenerator.GetType(Name)); }
public void GetTypeBeforeEachTest() { type = TypeGenerator.GetType(wanteType); }
public void InitializeBeforeEachTest() { type = TypeGenerator.GetType("StorageMaster"); this.storageMaster = (StorageMaster)Activator.CreateInstance(this.type, new object[] { }); }