Exemplo n.º 1
0
        public void GetToken_IgnoreWhitespace_ReturnsEndOfDataTokenIfNoMoreTokensAreAvailable()
        {
            WktTokensBuffer target = new WktTokensBuffer();

            var result = target.GetToken(false);

            Assert.Equal(WktToken.EndOfDataToken, result);
        }
Exemplo n.º 2
0
        public void GetToken_IgnoreWhitespace_GetsNextTokenFromBufferAndRemoveIt()
        {
            WktTokensBuffer target = new WktTokensBuffer();

            target.Add(_testData[0]);

            var result = target.GetToken(false);

            Assert.Equal(_testData[0], result);
            Assert.DoesNotContain(_testData[0], target);
        }
Exemplo n.º 3
0
        public void GetToken_IgnoreWhitespace_ReturnsEndOfDataTokenIfOnlyWhitespaceTokensAreAvailalbleAndIgnoreWhitespaceIsTrue()
        {
            WktToken whitespaceToken = new WktToken()
            {
                Type = TokenType.WHITESPACE, Value = " "
            };
            WktTokensBuffer target = new WktTokensBuffer();

            target.Add(whitespaceToken);

            var result = target.GetToken(true);

            Assert.Equal(WktToken.EndOfDataToken, result);
            Assert.Empty(target);
        }
Exemplo n.º 4
0
        public void GetToken_IgnoreWhitespace_ReturnsWhitespaceIfIgnoreWhitespaceIsFalseAndNextTokenIsWhitespace()
        {
            WktToken whitespaceToken = new WktToken()
            {
                Type = TokenType.WHITESPACE, Value = " "
            };
            WktTokensBuffer target = new WktTokensBuffer();

            target.Add(whitespaceToken);
            target.Add(_testData[0]);

            var result = target.GetToken(false);

            Assert.Equal(whitespaceToken, result);
            Assert.Equal(1, target.Count);
        }
Exemplo n.º 5
0
        public void GetToken_IgnoreWhitespace_IgnoresWhitespacesBeforeTokenIfIgnoreTokenIsTrue()
        {
            WktTokensBuffer target = new WktTokensBuffer();

            target.Add(new WktToken()
            {
                Type = TokenType.WHITESPACE, Value = " "
            });
            target.Add(new WktToken()
            {
                Type = TokenType.WHITESPACE, Value = " "
            });
            target.Add(_testData[0]);

            var result = target.GetToken(true);

            Assert.Equal(_testData[0], result);
            Assert.Equal(0, target.Count);
        }
        public void GetToken_IgnoreWhitespace_IgnoresWhitespacesBeforeTokenIfIgnoreTokenIsTrue()
        {
            WktTokensBuffer target = new WktTokensBuffer();
            target.Add(new WktToken() { Type = TokenType.WHITESPACE, Value = " " });
            target.Add(new WktToken() { Type = TokenType.WHITESPACE, Value = " " });
            target.Add(_testData[0]);

            var result = target.GetToken(true);

            Assert.Equal(_testData[0], result);
            Assert.Equal(0, target.Count);
        }
        public void GetToken_IgnoreWhitespace_GetsNextTokenFromBufferAndRemoveIt()
        {
            WktTokensBuffer target = new WktTokensBuffer();
            target.Add(_testData[0]);

            var result = target.GetToken(false);

            Assert.Equal(_testData[0], result);
            Assert.DoesNotContain(_testData[0], target);
        }
        public void GetToken_IgnoreWhitespace_ReturnsWhitespaceIfIgnoreWhitespaceIsFalseAndNextTokenIsWhitespace()
        {
            WktToken whitespaceToken = new WktToken() { Type = TokenType.WHITESPACE, Value = " " };
            WktTokensBuffer target = new WktTokensBuffer();
            target.Add(whitespaceToken);
            target.Add(_testData[0]);

            var result = target.GetToken(false);

            Assert.Equal(whitespaceToken, result);
            Assert.Equal(1, target.Count);
        }
        public void GetToken_IgnoreWhitespace_ReturnsEndOfDataTokenIfOnlyWhitespaceTokensAreAvailalbleAndIgnoreWhitespaceIsTrue()
        {
            WktToken whitespaceToken = new WktToken() { Type = TokenType.WHITESPACE, Value = " " };
            WktTokensBuffer target = new WktTokensBuffer();
            target.Add(whitespaceToken);

            var result = target.GetToken(true);

            Assert.Equal(WktToken.EndOfDataToken, result);
            Assert.Empty(target);
        }
Exemplo n.º 10
0
        public void GetToken_IgnoreWhitespace_ReturnsEndOfDataTokenIfNoMoreTokensAreAvailable()
        {
            WktTokensBuffer target = new WktTokensBuffer();

            var result = target.GetToken(false);

            Assert.Equal(WktToken.EndOfDataToken, result);
        }