I'm trying to mock a method call with a matcher, but JustMock fails to intercept the call properly. This is a test that fails for me:
I'm using JustMock Q2 2012 SP1 (2012.2.813.9).
[Fact]
public
void
ArrangeDoesNotMatchArguments()
{
string
value1 =
"Hello"
;
string
value2 =
"World"
;
var session = Mock.Create<IMockable>();
Mock.Arrange(() => session.Get<
string
>(Arg.Matches<
string
[]>(v => v.Contains(
"Lol"
) &&
v.Contains(
"cakes"
))))
.Returns(
new
[]
{
value1,
value2,
});
var testValues =
new
[]
{
"Lol"
,
"cakes"
};
var result = session.Get<
string
>(testValues);
Assert.Contains(value1, result);
Assert.Contains(value2, result);
}
public
interface
IMockable
{
T[] Get<T>(
params
string
[] values);
}