Example #1
0
        public void CalculateTest()
        {
            // test 01
            AbstractionSyntaxTree ast = new AbstractionSyntaxTree("=(a,b)");
            TruthTable            tb  = new TruthTable(ast);

            tb.Calculate();

            Assert.AreEqual(true, tb.isCalulated);
            Assert.AreEqual("1001", tb.Result);

            // test 02
            ast = new AbstractionSyntaxTree("=(>(a,b),b)");
            tb  = new TruthTable(ast);
            tb.Calculate();

            Assert.AreEqual(true, tb.isCalulated);
            Assert.AreEqual("0111", tb.Result);
        }