public void BracketOpeningTest()
        {
            IBracketOpener opener = new BracketOpener();

            var input = Helper.SplitSummands("2.5(3x + z)/0.50 - 5.66(5y - z)");

            var(multiplier, str) = opener.OpenBrackets(input);

            Assert.AreEqual(multiplier, 5);
            Assert.AreEqual(str, "3x + z");
            Assert.IsTrue(input.SequenceEqual(new[] { "- 5.66(5y ", "- z)" }));
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            IBracketOpener   bracketOpener   = new BracketOpener();
            ISummandBuilder  summandBuilder  = new SummandBuilder();
            IEquationBuilder equationBuilder = new EquationBuilder(bracketOpener, summandBuilder);

            IEquationIO equationIo;

            if (args.Length == 0)
            {
                equationIo = new EquationConsoleIO(equationBuilder);
            }
            else
            {
                equationIo = new EquationFileIO(equationBuilder, args[0]);
            }

            equationIo.Begin();

            Console.ReadKey();
        }