J. Davidson
J. Davidson

Reputation: 3317

mocking doesn't give return option

I am doing nunit testing using moq farmework. For some reasons I can't not get Returns option it should be like below

mock.Setup(foo => foo.Execute(It.IsAny<string>()))
    .Returns(true)
    .Callback((string s) => calls.Add(s));


but I can only write code like this 
mock.Setup(foo => foo.Execute(It.IsAny<string>()))
    .Callback((string s) => calls.Add(s));

it wont give me the Returns option. Any suggestions why it is doing this?

Upvotes: 0

Views: 60

Answers (1)

Simon Whitehead
Simon Whitehead

Reputation: 65077

Your method in the interface probably doesn't return bool. See the below example:

enter image description here

Upvotes: 3

Related Questions