Ejemplo n.º 1
0
        public void TryReadDomainLiteral_WithValidDomainLiteralAndEscapedCharacters_ShouldReadCorrectly()
        {
            int index = ValidDomainLiteralEscapedChars.Length - 1;

            Assert.True(DomainLiteralReader.TryReadReverse(ValidDomainLiteralEscapedChars, index, out index, throwExceptionIfFail: true));

            Assert.Equal(-1, index);
        }
Ejemplo n.º 2
0
        public void TryReadDomainLiteral_WithLongListOfBackslashes_ShouldReadCorrectly()
        {
            int index = ValidDomainBackslashList.Length - 1;

            Assert.True(DomainLiteralReader.TryReadReverse(ValidDomainBackslashList, index, out index, throwExceptionIfFail: true));

            Assert.Equal(-1, index);
        }
Ejemplo n.º 3
0
        public void TryReadDomainLiteral_WithInvalidCharacter_ShouldThrow()
        {
            int index = InvalidDomainLiteral.Length - 1;

            Assert.Throws <FormatException>(() => { DomainLiteralReader.TryReadReverse(InvalidDomainLiteral, index, out int _, throwExceptionIfFail: true); });
        }