Exemplo n.º 1
0
        public void test_primitiveAND()
        {
            QueryComponentParser parser = new QueryComponentParser();
            ANDOperator          op     = (ANDOperator)parser.parse("AND(B,C)");

            Assert.Equal(2, op.getChildren().Count());
            Assert.Equal(new EventType("B"), op.getChildren().ToList()[0]);
            Assert.Equal(new EventType("C"), op.getChildren().ToList()[1]);
        }
Exemplo n.º 2
0
        public void test_nestedAND()
        {
            QueryComponentParser parser = new QueryComponentParser();
            ANDOperator          op     = (ANDOperator)parser.parse("AND(AND(ABBA, D),C)");

            //var nestedExpected = new ANDOperator("AND(ABBA, D)");
            var nestedActualComponents = op.getChildren().ToList()[0].getChildren().ToList();


            Assert.Equal(2, op.getChildren().Count());

            Assert.IsType <ANDOperator>(op.getChildren().ToList()[0]);

            Assert.Equal(new EventType("C"), op.getChildren().ToList()[1]);

            Assert.Equal(new EventType("AND(ABBA, D)"), op.getChildren().ToList()[0].asEventType());

            Assert.Equal(new EventType("ABBA"), nestedActualComponents[0]);
            Assert.Equal(new EventType("D"), nestedActualComponents[1]);
        }