コード例 #1
0
        public void CalculateTestMethod1()
        {
            stackCalc.Calculate("1");
            Assert.AreEqual(1, stackCalc.Calculate("1"));

            Assert.AreEqual(2, stackCalc.Calculate("1 1 +"));
        }
コード例 #2
0
        public void CalculateTooLongExpressionTest()
        {
            stackCalc = new StackCalc(new ArrayList());
            string expression = "";

            for (int i = 0; i < 1001; ++i)
            {
                expression += "1 ";
            }
            for (int i = 0; i < 1000; ++i)
            {
                expression += "+ ";
            }
            stackCalc.Calculate(expression);
        }