public void TryReadDomainLiteral_WithValidDomainLiteralAndEscapedCharacters_ShouldReadCorrectly() { int index = ValidDomainLiteralEscapedChars.Length - 1; Assert.True(DomainLiteralReader.TryReadReverse(ValidDomainLiteralEscapedChars, index, out index, throwExceptionIfFail: true)); Assert.Equal(-1, index); }
public void TryReadDomainLiteral_WithLongListOfBackslashes_ShouldReadCorrectly() { int index = ValidDomainBackslashList.Length - 1; Assert.True(DomainLiteralReader.TryReadReverse(ValidDomainBackslashList, index, out index, throwExceptionIfFail: true)); Assert.Equal(-1, index); }
public void TryReadDomainLiteral_WithInvalidCharacter_ShouldThrow() { int index = InvalidDomainLiteral.Length - 1; Assert.Throws <FormatException>(() => { DomainLiteralReader.TryReadReverse(InvalidDomainLiteral, index, out int _, throwExceptionIfFail: true); }); }