public void Exception_InnerExceptions_are_included_by_default() { var ex = new InvalidOperationException("oh noes!", new NullReferenceException("oh my.", new DataException("oops!"))); ex.ToDisplayString() .Should() .Contain("NullReferenceException"); ex.ToDisplayString() .Should() .Contain("DataException"); }
public void Exception_Message_is_included_by_default() { var ex = new InvalidOperationException("oh noes!", new NullReferenceException()); var msg = ex.ToDisplayString(); msg.Should().Contain("oh noes!"); }
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.ToDisplayString(); msg.Should().Contain(key); msg.Should().Contain("123456"); }