Exemplo n.º 1
0
        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"));
        }
Exemplo n.º 2
0
        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"));
        }