public void ForceInitialize_UnitTest() { ExecuteMethod( () => { ForceInitialize_PreCondition(); }, () => { MappedObjectInitializer.ForceInitialize(); }, () => { ForceInitialize_PostValidate(); }); }
public void AnExceptionIsThrownIfATypeHasACreateMapMethodButNoAttributeInStrictMode() { var typesToIgnore = new List <Type>() { typeof(MappedObjectWithCreateMapMethod), typeof(MappedObjectWithCreateMapMethodWhichThrowsException), typeof(MappedObjectWithoutCreateMapMethod) }; MappedObjectInitializer.Initialize(typeof(MappedObjectTest).Assembly, typesToIgnore, true); }
public void AnExceptionIsThrownIfAMappingInitializerThrowsAnException() { int initialCount = MappedObjectWithCreateMapMethod.CreateMapCount; var typesToIgnore = new List <Type>() { typeof(MappedObjectInitializer), typeof(MappedObjectWithCreateMapMethod), typeof(ObjectWithCreateMapMethodButNoAttribute) }; MappedObjectInitializer.Initialize(typeof(MappedObjectTest).Assembly, typesToIgnore, true); }
public void AnExceptionIsNotThrownIfATypeHasACreateMapMethodButNoAttributeInStrictMode() { var typesToIgnore = new List <Type>() { typeof(MappedObjectWithCreateMapMethod), typeof(MappedObjectWithCreateMapMethodWhichThrowsException), typeof(MappedObjectWithoutCreateMapMethod) }; List <Type> success = MappedObjectInitializer.Initialize(typeof(MappedObjectTest).Assembly, typesToIgnore, false); Assert.That(success.Count, Is.EqualTo(0)); }
public void TheCreateMapMethodIsCalledOnTypesWithACreateMapMethodAndAttribute() { int initialCount = MappedObjectWithCreateMapMethod.CreateMapCount; var typesToIgnore = new List <Type>() { typeof(MappedObjectWithCreateMapMethodWhichThrowsException), typeof(MappedObjectWithoutCreateMapMethod), typeof(ObjectWithCreateMapMethodButNoAttribute) }; List <Type> success = MappedObjectInitializer.Initialize(typeof(MappedObjectTest).Assembly, typesToIgnore, true); Assert.That(success.Count, Is.EqualTo(1)); Assert.That(success.First(), Is.EqualTo(typeof(MappedObjectWithCreateMapMethod))); Assert.That(MappedObjectWithCreateMapMethod.CreateMapCount, Is.GreaterThan(initialCount)); }
public static void Assembly_Initialize(TestContext context) { MappedObjectInitializer.ForceInitialize(typeof(AttachmentWrapper).Assembly); }
static APIFactory() { MappedObjectInitializer.ForceInitialize(Assembly.GetExecutingAssembly()); }