Exception using Arg<T>.Matches to constrain an expectation on an internal method
Closed this issue · 3 comments
neontapir commented
I have a test:
var controller = MockRepository.GeneratePartialMock<UserAdminController>(mockUserService, fakeContext); // mockUserService is a strict mock
controller.Expect(x => x.Update(Arg<UserDetailModel>.Matches(y => !y.IsCreate))).Return(expectedResult);
If Update is public or protected internal, the test passes. If Update is internal, I get the following exception:
System.InvalidOperationException: When using Arg, all arguments must be defined using Arg.Is, Arg.Text, Arg.List, Arg.Ref or Arg.Out. 2 arguments expected, 1 have been defined.
neontapir commented
It's been over four years, I'm going to close this one.
elbaloo commented
@neontapir, project has been taken over by @meisinger, latest code is now at https://github.com/meisinger/rhino-mocks