public void CreateAnimalStub_AAA() { //Arrange MockRepository mocks = new MockRepository(); IAnimal animal = MockRepository.GenerateMock <IAnimal>(); animal.Expect(a => a.Legs).PropertyBehavior(); animal.Expect(a => a.Eyes).PropertyBehavior(); animal.Expect(a => a.Name).PropertyBehavior(); animal.Expect(a => a.Species).PropertyBehavior(); }
public void CanCreateExpectationOnMethod() { IAnimal animal = MockRepository.Mock <IAnimal>(); animal.Legs = 4; animal.Name = "Rose"; animal.Species = "Caucasusian Shepherd"; animal.Expect(x => x.GetMood()) .Return("Happy"); Assert.Equal("Happy", animal.GetMood()); animal.VerifyAllExpectations(); }