Esempio n. 1
0
        public void UseConcreteClassFor()
        {
            AutoMocker <ConcreteClass> mocker = createAutoMocker <ConcreteClass>();

            mocker.UseConcreteClassFor <ConcreteThing>();

            var thing = mocker.Get <ConcreteThing>();

            thing.ShouldBeOfType <ConcreteThing>();

            Assert.AreSame(mocker.Get <IMockedService>(), thing.Service);
            Assert.AreSame(mocker.Get <IMockedService2>(), thing.Service2);
        }
Esempio n. 2
0
        public void UseConcreteClassFor()
        {
            AutoMocker <ConcreteClass> mocker = createAutoMocker <ConcreteClass>();

            mocker.UseConcreteClassFor <ConcreteThing>();

            var thing = mocker.Get <ConcreteThing>();

            Assert.IsInstanceOfType(typeof(ConcreteThing), thing);

            Assert.AreSame(mocker.Get <IMockedService>(), thing.Service);
            Assert.AreSame(mocker.Get <IMockedService2>(), thing.Service2);
        }