예제 #1
0
        public void No_match_if_action_does_not_throw()
        {
            var matcher = new Throws<ArgumentException>();

            var match = matcher.Matches(() => { });

            NHAssert.That(match, Is.False());
        }
예제 #2
0
        public void No_match_if_thrown_exception_does_not_match_predicate()
        {
            var matcher = new Throws <ArgumentNullException>().With(e => e.Message == "something else");

            var matches = matcher.Matches(DoIt);

            NHAssert.That(matches, Is.False());
        }
예제 #3
0
        public void No_match_if_action_throws_different_exception()
        {
            var matcher = new Throws <NullReferenceException>();

            var match = matcher.Matches(DoIt);

            NHAssert.That(match, Is.False());
        }
예제 #4
0
        public void No_match_if_action_does_not_throw()
        {
            var matcher = new Throws <ArgumentException>();

            var match = matcher.Matches(() => { });

            NHAssert.That(match, Is.False());
        }
예제 #5
0
        public void No_match_if_thrown_exception_does_not_match_predicate()
        {
            var matcher = new Throws<ArgumentNullException>().With(e => e.Message == "something else");

            var matches = matcher.Matches(DoIt);

            NHAssert.That(matches, Is.False());
        }
예제 #6
0
        public void No_match_if_action_throws_different_exception()
        {
            var matcher = new Throws<NullReferenceException>();

            var match = matcher.Matches(DoIt);

            NHAssert.That(match, Is.False());
        }