public void Instantiate_WithoutCtorParameter_Instantiated() { var factory = new CustomConditionFactory(); var instance = factory.Instantiate ( typeof(CustomConditionWithoutParameter), new ReadOnlyDictionary <string, object>(new Dictionary <string, object>()) ); Assert.That(instance, Is.Not.Null); Assert.That(instance, Is.AssignableTo <ICustomCondition>()); }
public void Instantiate_MultipleConstructors_Instantiated() { var factory = new CustomConditionFactory(); var instance = factory.Instantiate ( typeof(CustomConditionWithMulipleCtors), new ReadOnlyDictionary <string, object>(new Dictionary <string, object>() { { "count", "5" }, { "name", "myName" }, }) ); Assert.That(instance, Is.Not.Null); Assert.That(instance, Is.AssignableTo <ICustomCondition>()); instance = factory.Instantiate ( typeof(CustomConditionWithMulipleCtors), new ReadOnlyDictionary <string, object>(new Dictionary <string, object>() { { "name", "myName" }, }) ); Assert.That(instance, Is.Not.Null); Assert.That(instance, Is.AssignableTo <ICustomCondition>()); instance = factory.Instantiate ( typeof(CustomConditionWithMulipleCtors), new ReadOnlyDictionary <string, object>(new Dictionary <string, object>() { }) ); Assert.That(instance, Is.Not.Null); Assert.That(instance, Is.AssignableTo <ICustomCondition>()); }
public void Instantiate_WithoutCtorTwoParametersIncorrectCase_Instantiated() { var factory = new CustomConditionFactory(); var instance = factory.Instantiate ( typeof(CustomConditionWithTwoParameters), new ReadOnlyDictionary <string, object>(new Dictionary <string, object>() { { "Count", "5" }, { "naME", "myName" }, }) ); Assert.That(instance, Is.Not.Null); Assert.That(instance, Is.AssignableTo <ICustomCondition>()); }