Пример #1
0
        //static void Main(string[] args)
        //{
        //    main();
        //    ReadLine();
        //}
        static void main()
        {
            var e = new AdditionExpression(
                new DoubleExpression(1),
                new AdditionExpression(
                    new DoubleExpression(2),
                    new DoubleExpression(3)
                    )
                );
            var sb = new StringBuilder();

            e.Print(sb);
            WriteLine(sb);
        }
Пример #2
0
        public void BasicTest()
        {
            var e = new AdditionExpression(
                new DoubleExpression(1),
                new AdditionExpression(
                    new DoubleExpression(2),
                    new DoubleExpression(3)
                    )
                );
            var sb = new StringBuilder();

            e.Print(sb);
            Assert.AreEqual("(1+(2+3))", sb.ToString());
        }