var repository = mocks.StrictMock
var controller = new AController(repository);
List
var modelObj = new ModelObj(items);
Predicate
delegate(ModelObj m) { return m.Items.AsEnumerable().SequenceEqual(items); }
repository.Expect(r => r.SaveModelObj(null)).Constraints(Is.Matching(compareModelObjs)).Return(true);
mocks.ReplayAll();
controller.Save(items);
mocks.VerifyAll();
Of course, you should probably write an Equals() method on the ModelObj.
No comments:
Post a Comment