Ejemplo n.º 1
0
 public void should_return_failed_status()
 {
     var result = new RuleExecution().RunRule(happymethod, "test rule", typeof(AssertionException));
     Assert.AreEqual(result.Status, RuleStatus.Failed);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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"));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }