示例#1
0
        public static ExpressionStructureDto EvaluateExpression(string expressionValue)
        {
            ExpressionStructure structure = new ExpressionStructure(new PrefixExpression(expressionValue));

            structure.BuildExpressionTree();
            structure.BuildTruthTable();
            return(new ExpressionStructureDto(structure));
        }
示例#2
0
        public void BuildTruthTable_Should_Create_TruthTable_From_ExpressionTree()
        {
            ExpressionStructure structure = new ExpressionStructure(_mockPrefixExpression.Object);

            structure.BuildExpressionTree();
            structure.BuildTruthTable();

            structure.TruthTable.Should().NotBeNull();
        }
示例#3
0
        public void BuildTruthTable_Should_Throw_NullReferenceException_When_The_ExpressionTree_Is_Null()
        {
            ExpressionStructure structure = new ExpressionStructure(_mockPrefixExpression.Object);

            Assert.Throws <NullReferenceException>(() => structure.BuildTruthTable());
        }