Ejemplo n.º 1
0
        public void Should_Throw_Argument_Exception_When_Invalid_Input_Is_Passed()
        {
            var provider   = new NumberTokenProvider(new HashSet <char>());
            var expression = " 32.23";

            Assert.Throws <ArgumentException>(() => provider.GetToken(0, expression));
        }
Ejemplo n.º 2
0
        public void Should_Return_Number_Token_When_Decimal_Is_Passed()
        {
            var provider   = new NumberTokenProvider(new HashSet <char>());
            var expression = "32.23";
            var result     = provider.GetToken(0, expression);

            Assert.Equal(0, result.StartIndex);
            Assert.Equal(4, result.EndIndex);
            Assert.Equal("32.23", result.Token.Value);
            Assert.IsType <NumberToken>(result.Token);
        }