Reputation: 3317
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
Reputation: 65077
Your method in the interface probably doesn't return bool
. See the below example:
Upvotes: 3