예제 #1
0
        public void Should_Throw_ArgumentException_At_Invalid_Input()
        {
            var provider   = new SkipTokenProvider();
            var expression = "name = 'tata' ";

            Assert.Throws <ArgumentException>(() => provider.GetToken(0, expression));
        }
예제 #2
0
        public void Should_Return_SkipToken()
        {
            var provider   = new SkipTokenProvider();
            var expression = "name = 'tata' and amount < 43 and comment contains 'vyber'";
            var result     = provider.GetToken(4, expression);

            Assert.Equal(" ", result.Token.Value);
            Assert.IsType <SkipToken>(result.Token);
            Assert.Equal(4, result.StartIndex);
            Assert.Equal(4, result.EndIndex);
        }
예제 #3
0
        public void Should_Return_SkipToken_At_End()
        {
            var provider   = new SkipTokenProvider();
            var expression = "name = 'tata' ";
            var result     = provider.GetToken(13, expression);

            Assert.Equal(" ", result.Token.Value);
            Assert.IsType <SkipToken>(result.Token);
            Assert.Equal(13, result.StartIndex);
            Assert.Equal(13, result.EndIndex);
        }