Esempio n. 1
0
        public void DemoLegsProperty()
        {
            IAnimal animalStub = MockRepository.GenerateStub<IAnimal>();

            animalStub.Legs = 0;
            Assert.Equal(0, animalStub.Legs);

            SomeClass instance = new SomeClass(animalStub);
            instance.SetLegs(10);
            Assert.Equal(10, animalStub.Legs);
        }
Esempio n. 2
0
        public void DemoStubAllLegsProperty()
        {
            ICat catStub = MockRepository.GenerateStub<ICat>();

            catStub.Legs = 0;
            Assert.Equal(0, catStub.Legs);

            SomeClass instance = new SomeClass(catStub);
            instance.SetLegs(10);
            Assert.Equal(10, catStub.Legs);
        }