public void InjectAStubAndGetTheStubBack() { var stub = new StubService(); _container.Inject <IMockedService>(stub); stub.ShouldBeTheSameAs(_container.GetInstance <IMockedService>()); stub.ShouldBeTheSameAs(_container.GetInstance <IMockedService>()); stub.ShouldBeTheSameAs(_container.GetInstance <IMockedService>()); }
public void TheAutoMockerPushesInMocksAndAPreBuiltStubForAllOfTheConstructorArguments() { var autoMocker = createAutoMocker <ConcreteClass>(); var stub = new StubService(); autoMocker.Inject <IMockedService>(stub); var service2 = autoMocker.Get <IMockedService2>(); var service3 = autoMocker.Get <IMockedService3>(); var concreteClass = autoMocker.ClassUnderTest; stub.ShouldBeTheSameAs(concreteClass.Service); service2.ShouldBeTheSameAs(concreteClass.Service2); service3.ShouldBeTheSameAs(concreteClass.Service3); }