public ExpressionStructureDto(ExpressionStructure structure) { this.TruthTable = structure.TruthTable.Value; this.SimplifiedTruthTable = new SimplifiedTruthTableValues { Values = structure.TruthTable.Simplify(), DontCareCharacter = QuineMcCluskey.DONT_CARE }; this.HexResult = structure.TruthTable.HexResult; this.Nodes = structure.ExpressionTree.GetNodes(); this.Edges = structure.ExpressionTree.GetEdges(); this.Leafs = System.String.Join(",", structure.ExpressionTree.GetLeafs()); this.DNF = structure.TruthTable.NormalizeOriginal().Value; this.SimplifiedDNF = structure.TruthTable.NormalizeSimplified().Value; this.InfixNotation = structure.ToString(); this.Nandify = structure.PrefixExpression.NandifyExpression(); }
public void ToString_Should_Return_InfixNotation_From_PrefixExpression() { ExpressionStructure structure = new ExpressionStructure(_mockPrefixExpression.Object); structure.ToString().Should().BeEquivalentTo(VALID_INFIX); }