コード例 #1
0
        public void TheAutoMockerPushesInMocksAndAPreBuiltStubForAllOfTheConstructorArguments()
        {
            AutoMocker <ConcreteClass> autoMocker = createAutoMocker <ConcreteClass>();
            var stub = new StubService();

            autoMocker.Inject <IMockedService>(stub);

            var service2 = autoMocker.Get <IMockedService2>();
            var service3 = autoMocker.Get <IMockedService3>();

            ConcreteClass concreteClass = autoMocker.ClassUnderTest;

            Assert.AreSame(stub, concreteClass.Service);
            Assert.AreSame(service2, concreteClass.Service2);
            Assert.AreSame(service3, concreteClass.Service3);
        }
コード例 #2
0
 public override void BeforeTestClassCreation()
 {
     AutoMocker.Inject <MicrosoftAppCredentials>(Credentials);
 }