Esempio n. 1
0
 public void ThenTheResultShouldBeOnTheScreen(int p0)
 {
     RPNCalculator calc = new RPNCalculator();
     int result = calc.MyCalc(expr);
     Assert.AreEqual(8, result);
     //ScenarioContext.Current.Pending();
 }
Esempio n. 2
0
        public void MyCalcTest()
        {
            try
            {
                RPNCalculator calc = new RPNCalculator();
                int result = calc.MyCalc(" ");
                Assert.Fail();
            }

            catch(Exception ex)
            {
                Assert.AreEqual("Invalid Exp", ex.Message);
            }
        }
Esempio n. 3
0
        public void TestStack()
        {
            try
            {
                RPNCalculator calc = new RPNCalculator();

                Stack<int> st = new Stack<int>();
                
                //int result = calc.OperateStack(("3,5,+","+");
                Assert.Fail();
            }

            catch (Exception ex)
            {
                Assert.AreEqual("Invalid Exp", ex.Message);
            }
        }   
Esempio n. 4
0
 public void TestCalc()
 {
     RPNCalculator calc = new RPNCalculator();
     int result = calc.PerformCalc(3, 5, "+");
     Assert.AreEqual(8, result);
 }
Esempio n. 5
0
 public void TestMethod1()
 {
     RPNCalculator obj = new RPNCalculator();
     Int32 []arr = {3,4,6,8,1};
     Assert.AreEqual(8, obj.find(arr));
 }