Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }