public static ExpressionStructureDto EvaluateExpression(string expressionValue) { ExpressionStructure structure = new ExpressionStructure(new PrefixExpression(expressionValue)); structure.BuildExpressionTree(); structure.BuildTruthTable(); return(new ExpressionStructureDto(structure)); }
public void BuildTruthTable_Should_Create_TruthTable_From_ExpressionTree() { ExpressionStructure structure = new ExpressionStructure(_mockPrefixExpression.Object); structure.BuildExpressionTree(); structure.BuildTruthTable(); structure.TruthTable.Should().NotBeNull(); }
public void BuildTruthTable_Should_Throw_NullReferenceException_When_The_ExpressionTree_Is_Null() { ExpressionStructure structure = new ExpressionStructure(_mockPrefixExpression.Object); Assert.Throws <NullReferenceException>(() => structure.BuildTruthTable()); }