public void DemoLegsProperty() { IAnimal animalStub = MockRepository.Mock<IAnimal>(); animalStub.Legs = 0; Assert.Equal(0, animalStub.Legs); SomeClass instance = new SomeClass(animalStub); instance.SetLegs(10); Assert.Equal(10, animalStub.Legs); }
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); }