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

            var result = target.GetToken(false);

            Assert.Equal(WktToken.EndOfDataToken, result);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
        public void GetToken_IgnoreWhitespace_ReturnsEndOfDataTokenIfNoMoreTokensAreAvailable()
        {
            WktTokensBuffer target = new WktTokensBuffer();

            var result = target.GetToken(false);

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