コード例 #1
0
        public void CompareStrings()
        {
            var Left = new Operator
            {
                Text = "operador",
            };
            var Right = new Operator
            {
                Text = "operador",
            };
            NodeLogic nodeLogic = new NodeLogic(null);

            Assert.IsTrue(nodeLogic.Compare(Left, Right, "="));
        }
コード例 #2
0
        public void CompareBoolOperator()
        {
            var area = new Area {
                DataSource = "Server=localhost\\SQLEXPRESS;Database=DataSourceDB;Trusted_Connection=True;",
            };
            var Left1 = new Operator
            {
                Type = 3,
                Text = "SELECT UserId FROM ACCOUNT WHERE UserId = 'ALFKI'",
                Area = 1,
            };
            var Right1 = new Operator
            {
                Type = 1,
                Text = "ALFKI",
            };

            var binaryLeft = new BinaryOperator
            {
                Type  = 4,
                Left  = Left1,
                Right = Right1,
                Sign  = "=",
            };

            var Left2 = new Operator
            {
                Type = 3,
                Text = "SELECT count(*) FROM ACCOUNT",
                Area = 1,
            };
            var Right2 = new Operator
            {
                Type = 2,
                Text = "5",
            };
            var binaryRight = new BinaryOperator
            {
                Type  = 4,
                Left  = Left2,
                Right = Right2,
                Sign  = ">",
            };

            NodeLogic nodeLogic = new NodeLogic(null);

            Assert.IsTrue(nodeLogic.Compare(binaryLeft, binaryRight, "AND"));
        }
コード例 #3
0
        public void CompareEqualsNumeric()
        {
            var Left = new Operator
            {
                Type = 2,
                Text = "123",
            };
            var Right = new Operator
            {
                Type = 2,
                Text = "123",
            };
            NodeLogic nodeLogic = new NodeLogic(null);

            Assert.IsTrue(nodeLogic.Compare(Left, Right, "="));
        }
コード例 #4
0
        public void CompareSQLNumeric()
        {
            var area = new Area {
                DataSource = "Server=localhost\\SQLEXPRESS;Database=DataSourceDB;Trusted_Connection=True;",
            };
            var Left = new Operator
            {
                Type = 3,
                Text = "SELECT count(*) FROM ACCOUNT",
                Area = 1,
            };
            var Right = new Operator
            {
                Type = 2,
                Text = "5",
            };
            NodeLogic nodeLogic = new NodeLogic(null);

            Assert.IsTrue(nodeLogic.Compare(Left, Right, ">"));
        }
コード例 #5
0
        public void CompareSQLString()
        {
            var area = new Area {
                DataSource = "Server=localhost\\SQLEXPRESS;Database=DataSourceDB;Trusted_Connection=True;",
            };
            var Left = new Operator
            {
                Type = 3,
                Text = "SELECT UserId FROM ACCOUNT WHERE UserId = 'ALFKI'",
                Area = 1,
            };
            var Right = new Operator
            {
                Type = 1,
                Text = "ALFKI",
            };
            NodeLogic nodeLogic = new NodeLogic(null);

            Assert.IsTrue(nodeLogic.Compare(Left, Right, "="));
        }