Hi,
The following code does not work...
Is this a limitation of JustMock?
Regards,
Nick
The following code does not work...
public
interface
IService2
{
string
MethodWithArgs(
string
one,
string
two);
}
[TestMethod]
public
void
SubbingMethodwithArgs_DontCareAboutValues_StubbedMethodCalled()
{
var service = StubMethodWithArgs(
"rv"
);
var actual = service.MethodWithArgs(
"a"
,
"b"
);
Assert.AreEqual(
"rv"
, actual);
}
private
static
IService2 StubMethodWithArgs(
string
returnValue,
string
expectedOne =
null
,
string
expectedTwo =
null
)
{
var service = Mock.Create<IService2>();
service
.Arrange(s => s.MethodWithArgs(
null
!= expectedOne ? Arg.Is(expectedOne) : Arg.AnyString,
// null coalesance (??) doesn't work either
null
!= expectedTwo ? Arg.Is(expectedTwo) : Arg.AnyString))
.Returns(returnValue);
return
service;
}
Is this a limitation of JustMock?
Regards,
Nick