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