예제 #1
0
        public void TestDivideException()
        {
            ICalculatingStack calc = new CalculatingStack();

            Assert.Equal(0, calc.Current);
            calc.Add(4);
            Assert.Throws <ArgumentException>(() => calc.Divide(0));
        }
예제 #2
0
        public void DivideTest3(int x, int y, int res)
        {
            ICalculatingStack calc = new CalculatingStack();

            calc.Add(x);
            calc.Divide(y);
            Assert.Equal(calc.Current, res);
        }
예제 #3
0
        public void TestDivide()
        {
            ICalculatingStack calc = new CalculatingStack();

            Assert.Equal(0, calc.Current);
            calc.Add(8);
            calc.Divide(4);
            Assert.Equal(2, calc.Current);
        }