I have a NaturalMock setup that I want to check the 1st and 2nd parameters of a params array against LogMessage, shown below.
public void LogMessage(string message, params object[] messageArgs)
I do not care what the value of the 1st parameter (message) is.
The following test fails with VerifyMocks as follows:
Test method TeamHelp.Build.Tasks.Utilities.MSBuildRunnerTest.RunLogsItsStartUp threw exception: TypeMock.TypeMockException:
*** Too Many Arguments to validate (expected up to 2 but found 3 ).
What am I doing wrong?
Thanx
Tim
[TestMethod]
public void RunLogsItsStartUp()
{
MSBuildRunner target = this.GetTestableTarget();
MSBuildRunner_Accessor a = MSBuildRunner_Accessor.AttachShadow(target);
string path = @"c:
othing.exe";
string arguments = "arguments";
using (RecordExpectations r = new RecordExpectations())
{
target.Log.LogMessage(string.Empty, path, arguments);
r.CheckArguments( Check.IsAny(), path, arguments );
}
a.Run( path, arguments );
}