Hi All;
Trying to mock the following method:
bool IsLoginValid(LoginViewModel viewModel, out User user);
Tried this initially:
dependency<ILoginService>()
.Stub(serv =>
serv.IsLoginValid(
Arg<LoginViewModel>.Is.Equal(a_login_viewmodel),
out Arg<User>.Is.Anything)
.Return(false);
But, that fails, as it is an out parameter. Did a bit of searching around and altered my code like such:
dependency<ILoginService>()
.Stub(serv =>
serv.IsLoginValid(
Arg<LoginViewModel>.Is.Equal(a_login_viewmodel),
out Arg<User>.Out(new User()).Dummy))
.Return(false);
That also fails. I need 'new User()' to be sort of an 'Anything' argument. As I think that is expecting a specific instance.
Any idea how to get around this? Thanks guys.