public void Supports_custom_argument_matchers() { var subs = Substitute.For <ISomething>(); subs.Echo(IsFortyTwo.Arg()).Returns("42"); var result = subs.Echo(42); Assert.That(result, Is.EqualTo("42")); }
public void Supports_custom_argument_matcher_descriptions() { var subs = Substitute.For <ISomething>(); subs.Echo(24); var ex = Assert.Throws <ReceivedCallsException>(() => { // subs.Received().Echo(IsFortyTwo.Arg()); }); Assert.That(ex.Message, Contains.Substring("24 is not forty two")); }