Hi
This feature is not supported with the AAA syntax.
It is however in our features list.
We still need to figure out how to do it while keeping the simplicity of the AAA syntax (which is the main point here :)).
Now its quit simple:
Once the user type 'Verify.' he gets the two most common options
WasCalledWithExactArguments and WasCalledWithAnyArguments
Any ideas how to do it 'cleanly'?
What about a method like this
WasCallWithArguments(action).SetParam(params object[] UrParams)
The UrParams is a list of parameter objects. If the method takes 3 parameter, and the user doesn't bother about the first parameter, then he can set the UrlParams[0] as the enum Mocker.ANY.
Let's say I have such a class
public class Logger()
{
public void GetInformation(string str1, string str2, double doub1)
{
}
}
And I don't care about what str1 is
but I do care about str2 and doub1. So my test code would be
public void TestGetInformation()
{
Logger fake = Isolate.Fake.Instance<Logger>();
Isolate.Verify. WasCallWithArguments(() => fake. GetInformation("", "", 1). SetParam(new object[]{MOCKER.ANY, "oh", 1000.0}));
}
In this case, if the str2 is not "oh" or if doub1 is not "1000.0", then exception will be thrown. Otherwise it will pass.
Not sure it helps or not, just my 2 cents. :wink:
________
buy herbalaire