public void ShifterAddType_AdditionOfAbstractClassAsTypeToBeResolved_AnExceptionIsThrown() { var shifter = new ShifterContainer(); var resolvedClass = shifter .AddType(typeof(IResolveTest), typeof(AbstractClass)) .Resolve <ResolveTestClass>(); }
public void ShifterAddType_AdditionOfTypeWithDefaultConstructor_TheTypeIsResolved() { var shifter = new ShifterContainer(); var resolvedClass = shifter .AddType(typeof(IResolveTest), typeof(DefaultConstructorResolveTest)) .Resolve <IResolveTest>(); Assert.IsNotNull(resolvedClass); Assert.IsInstanceOfType(resolvedClass, typeof(DefaultConstructorResolveTest)); }
public void ShifterAddInstance_AddInstanceReturnsShiftContainer_TheShiftContainerIsReturned() { var shifter = new ShifterContainer(); IShifterContainer container = shifter.AddInstance(new object()); Assert.AreSame(shifter, container); container = shifter.AddInstance <IResolveTest>(new ImplementsResolveTest()); Assert.AreSame(shifter, container); container = shifter.AddInstance(typeof(ResolveTestClass), new ResolveTestClass()); Assert.AreSame(shifter, container); container = shifter.AddType(typeof(IComparable), typeof(String)); Assert.AreSame(shifter, container); container = shifter.AddType <IResolveTest2, ImplementsResolveTest2>(); Assert.AreSame(shifter, container); }
public void ShifterAddType_SecondParameterIsNull_AnExceptionIsThrown() { var shifter = new ShifterContainer(); shifter.AddType(typeof(IShifterContainer), null); }
public void ShifterAddType_FirstParameterIsNull_AnExceptionIsThrown() { var shifter = new ShifterContainer(); shifter.AddType(null, typeof(string)); }