예제 #1
0
        public void TestTokeniserOperators()
        {
            IdfToken tk = new IdfToken("+", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Operator);
            Assert.AreEqual(tk.Operator.Op, "+");

            tk = new IdfToken("-", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Operator);
            Assert.AreEqual(tk.Operator.Op, "-");

            tk = new IdfToken("*", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Operator);
            Assert.AreEqual(tk.Operator.Op, "*");

            tk = new IdfToken("/", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Operator);
            Assert.AreEqual(tk.Operator.Op, "/");

            tk = new IdfToken("and", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Operator);
            Assert.AreEqual(tk.Operator.Op, "and");

            tk = new IdfToken("xor", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Operator);
            Assert.AreEqual(tk.Operator.Op, "xor");


        }
예제 #2
0
        public void TestTokeniserFunctions()
        {
            IdfToken tk = new IdfToken("formcfilter", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Function);

            tk = new IdfToken("acib", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Function);

        }
예제 #3
0
        public void TestTokeniserLiterals()
        {
            IdfToken tk = new IdfToken("point1", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Literal);

            tk = new IdfToken("poiandt1", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Literal);

            tk = new IdfToken("andsksks", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Literal);

            tk = new IdfToken("ftojsjdand", operators, functions);
            Assert.AreEqual(tk.Type, IdfTokenType.Literal);
        }