--
--
Post: moq...@googlegroups.com
Unsubscribe: moqdisc-u...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Moq Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moqdisc+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Standa, you mean something like this:
public interface IFoo {
int Bar(string arg);
} [Test]
public void ResultBasedOnInputParams() {
var mock = Mock.Of<IFoo>(f =>
f.Bar("foo") == 123
&& f.Bar("bar") == 456
&& f.Bar("baz") == 789);
Assert.AreEqual(123, mock.Bar("foo"));
Assert.AreEqual(456, mock.Bar("bar"));
Assert.AreEqual(789, mock.Bar("baz"));
Assert.AreEqual(0, mock.Bar("anything else"));
}
Not sure if it is what you are looking for, but this way you can specify different results based on the value of an input params….
Ale Miralles.