public void compute_visitor(string expression, double expected) { var analyzer = new NodeAnalyzer(); var tree = analyzer.Parse(expression); var computeVisitor = new ComputeVisitor(); computeVisitor.VisitNode(tree); computeVisitor.ComputedResult.Should().Be(expected); }
public void plus_to_minus_mutator(string expression, double expected) { var analyzer = new NodeAnalyzer(); var tree = analyzer.Parse(expression); var mutator = new PlusToMinusMutator(); tree = mutator.MutateNode(tree); var computeVisitor = new ComputeVisitor(); computeVisitor.VisitNode(tree); computeVisitor.ComputedResult.Should().Be(expected); }