예제 #1
0
 public void should_return_failed_status()
 {
     var result = new RuleExecution().RunRule(happymethod, "test rule", typeof(AssertionException));
     Assert.AreEqual(result.Status, RuleStatus.Failed);
 }
예제 #2
0
        public void should_explain_expected_exception_was_supposed_to_be()
        {
            var result = new RuleExecution().RunRule(happymethod , "test rule", typeof(AssertionException));

            StringAssert.Contains("Expected exception was NUnit.Framework.AssertionException but it never occured", result.RuleMessage);
        }
예제 #3
0
 public void should_store_error_message_for_rule_exceptions()
 {
     var result = new RuleExecution().RunRule(() => { throw new RuleException("this is an error"); }, "test rule");
     Assert.IsTrue(result.RuleMessage.Contains( "this is an error"));
 }
예제 #4
0
 public void should_return_failed_status()
 {
     var result = new RuleExecution().RunRule(() => { throw new AbandonedMutexException(); }, "test rule", typeof(AssertionException));
     Assert.AreEqual(result.Status, RuleStatus.Failed);
 }
예제 #5
0
 public void should_ignore_errors_that_are_expected()
 {
     var result = new RuleExecution().RunRule(() => { throw new AbandonedMutexException(); }, "test rule", typeof(AbandonedMutexException));
     Assert.AreEqual(result.Status, RuleStatus.Passed);
 }
예제 #6
0
        public void should_explain_expected_exception_was_supposed_to_be()
        {
            var result = new RuleExecution().RunRule(() => { throw new AbandonedMutexException(); }, "test rule", typeof(AssertionException));

            StringAssert.Contains("Expected exception was NUnit.Framework.AssertionException but instead was System.Threading.AbandonedMutexException", result.RuleMessage);
        }