public void ReadQuotedPair_WithInvalidNonescapedCharacter_ShouldThrow() { // this is a\\\\" string backslashes = "a\\\\\\\\\""; int index = backslashes.Length - 1; int quotedCharCount = QuotedPairReader.CountQuotedChars(backslashes, index, false); Assert.Equal(0, quotedCharCount); }
public void ReadQuotedPair_WithValidCharacterAndEscapedCharacterAndBackslashIsStartOfString_ShouldReadCorrectly() { // this is \\\\\" string backslashes = "\\\\\\\\\\\""; int index = backslashes.Length - 1; int quotedCharCount = QuotedPairReader.CountQuotedChars(backslashes, index, false); Assert.Equal(6, quotedCharCount); }
public void ReadQuotedPair_WithValidCharacters_ShouldReadCorrectly() { // a\\\\b, even quotes, b is unqouted string backslashes = "a\\\\\\\\b"; int index = backslashes.Length - 1; int quotedCharCount = QuotedPairReader.CountQuotedChars(backslashes, index, false); Assert.Equal(0, quotedCharCount); }
public void TryReadQuotedPair_WithInvalidNonescapedCharacter_ShouldThrow() { // this is a\\\\" string backslashes = "a\\\\\\\\\""; int index = backslashes.Length - 1; Assert.True(QuotedPairReader.TryCountQuotedChars(backslashes, index, false, out int quotedCharCount, throwExceptionIfFail: true)); Assert.Equal(0, quotedCharCount); }
public void TryReadQuotedPair_WithValidCharacterAndEscapedCharacterAndBackslashIsStartOfString_ShouldReadCorrectly() { // this is \\\\\" string backslashes = "\\\\\\\\\\\""; int index = backslashes.Length - 1; Assert.True(QuotedPairReader.TryCountQuotedChars(backslashes, index, false, out int quotedCharCount, throwExceptionIfFail: true)); Assert.Equal(6, quotedCharCount); }
public void TryReadQuotedPair_WithValidCharacters_ShouldReadCorrectly() { // a\\\\b, even quotes, b is unqouted string backslashes = "a\\\\\\\\b"; int index = backslashes.Length - 1; Assert.True(QuotedPairReader.TryCountQuotedChars(backslashes, index, false, out int quotedCharCount, throwExceptionIfFail: true)); Assert.Equal(0, quotedCharCount); }