public override void AddUsersToRoles(string[] usernames, string[] rolenames)
{
BDCInterface.AddUsersToRoles("instanceName", usernames, rolenames);
}
How can I write a mock for BDCInterface.AddUsersToRoles?
string[] usernames = new string[] { "un1", "un2", "un3" };
string[] rolenames = new string[] { "rn1", "rn2", "rn3" };
// mock AddUsersToRoles
Action action = delegate { BDCInterface.AddUsersToRoles("instanceName", usernames, rolenames); };
Isolate.WhenCalled(action).IgnoreCall();
// exercise
cmisRoleProvider.AddUsersToRoles(usernames, rolenames);
// verify
Isolate.Verify.WasCalledWithExactArguments(action);
Problem:
When it reaches to the verify line, it fails and it says that that method was not called with those arguments ...
How can I verify the input parameters?