示例#1
0
		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);
		}
示例#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);
        }