public void Describe_mismatch_if_thrown_exception_does_not_match_predicate() { var matcher = new Throws<ArgumentNullException>().With(e => e.Message == "something else"); var description = new StringDescription(); matcher.DescribeMismatch(DoIt, description); NHAssert.That(description.ToString(), Starts.With("the exception was of the correct type, but did not match the predicate")); }
public void Describe_mismatch_if_action_throws_different_exception() { var matcher = new Throws<NullReferenceException>(); var description = new StringDescription(); matcher.DescribeMismatch(DoIt, description); NHAssert.That(description.ToString(), Starts.With("an exception of type System.ArgumentNullException was thrown")); }
public void Describe_mismatch_if_action_does_not_throw() { var matcher = new Throws<ArgumentException>(); var description = new StringDescription(); matcher.DescribeMismatch(() => { }, description); NHAssert.That(description.ToString(), Is.EqualTo("no exception was thrown")); }
public void Describe_mismatch_if_thrown_exception_does_not_match_predicate() { var matcher = new Throws <ArgumentNullException>().With(e => e.Message == "something else"); var description = new StringDescription(); matcher.DescribeMismatch(DoIt, description); NHAssert.That(description.ToString(), Starts.With("the exception was of the correct type, but did not match the predicate")); }
public void Describe_mismatch_if_action_throws_different_exception() { var matcher = new Throws <NullReferenceException>(); var description = new StringDescription(); matcher.DescribeMismatch(DoIt, description); NHAssert.That(description.ToString(), Starts.With("an exception of type System.ArgumentNullException was thrown")); }
public void Describe_mismatch_if_action_does_not_throw() { var matcher = new Throws <ArgumentException>(); var description = new StringDescription(); matcher.DescribeMismatch(() => { }, description); NHAssert.That(description.ToString(), Is.EqualTo("no exception was thrown")); }