public void Exception_Message_is_included_by_default() { var ex = new InvalidOperationException("oh noes!", new NullReferenceException()); var msg = ex.ToLogString(); Assert.That(msg, Contains.Substring("oh noes!")); }
public void Exception_InnerExceptions_are_included_by_default() { var ex = new InvalidOperationException("oh noes!", new NullReferenceException("oh my.", new DataException("oops!"))); Assert.That(ex.ToLogString(), Contains.Substring("NullReferenceException")); Assert.That(ex.ToLogString(), Contains.Substring("DataException")); }
public void Exception_Data_is_included_by_default() { var ex = new InvalidOperationException("oh noes!", new NullReferenceException()); var key = "a very important int"; ex.Data[key] = 123456; var msg = ex.ToLogString(); Assert.That(msg, Contains.Substring(key)); Assert.That(msg, Contains.Substring("123456")); }