public void WhenNotCalled () { IModelRepository mock = MockRepository.GenerateMock<IModelRepository> (); var modelCreator = new ModelCreator (mock); var theModel = new AnotherModel () { FieldA = 1, FieldB = "Test" }; modelCreator.CreateModel (theModel); mock.AssertWasNotCalled (p => p.Add (Arg<AnotherModel>.Is.Null)); }
public void WhenArgumentIsAnything () { IModelRepository mock = MockRepository.GenerateMock<IModelRepository> (); var modelCreator = new ModelCreator (mock); var theModel = new AnotherModel () { FieldA = 1, FieldB = "Test" }; mock.Expect (p => p.Add (Arg<AnotherModel>.Is.Anything)); modelCreator.CreateModel (theModel); mock.VerifyAllExpectations (); }
public void WhenNotCalled() { IModelRepository mock = MockRepository.GenerateMock <IModelRepository> (); var modelCreator = new ModelCreator(mock); var theModel = new AnotherModel() { FieldA = 1, FieldB = "Test" }; modelCreator.CreateModel(theModel); mock.AssertWasNotCalled(p => p.Add(Arg <AnotherModel> .Is.Null)); }
public void WhenArgumentIsAnything() { IModelRepository mock = MockRepository.GenerateMock <IModelRepository> (); var modelCreator = new ModelCreator(mock); var theModel = new AnotherModel() { FieldA = 1, FieldB = "Test" }; mock.Expect(p => p.Add(Arg <AnotherModel> .Is.Anything)); modelCreator.CreateModel(theModel); mock.VerifyAllExpectations(); }