public void VerifyToStringWithInnerException() { var exception = new YamlException("Test exception message", new InvalidOperationException("Test inner exception")); exception.ToString().Should().Be("(Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 1, Idx: 0): Test exception message"); exception.Message.Should().Be("Test exception message"); }
public void VerifyToStringWithNonEmptyMarks() { var exception = new YamlException(new Mark(1, 1, 1), new Mark(10, 10, 10), "Test exception message"); exception.ToString().Should().Be("(Line: 1, Col: 1, Idx: 1) - (Line: 10, Col: 10, Idx: 10): Test exception message"); exception.Message.Should().Be("Test exception message"); }
public void VerifyToStringWithInnerExceptionAndMarks() { var exception = new YamlException(new Mark(1, 1, 1), new Mark(10, 10, 10), "Test exception message", new InvalidOperationException("Test inner exception")); exception.ToString().Should().Be("(Line: 1, Col: 1, Idx: 1) - (Line: 10, Col: 10, Idx: 10): Test exception message"); exception.Message.Should().Be("Test exception message"); }
public void VerifyToStringWithEmptyMarks() { var exception = new YamlException(Mark.Empty, Mark.Empty, "Test exception message"); exception.ToString().Should().Be("(Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 1, Idx: 0): Test exception message"); exception.Message.Should().Be("Test exception message"); }