예제 #1
0
        public void ThenOutput(int p0)
        {
            //ScenarioContext.Current.Pending();
            RPNCal obj = new RPNCal();

            Assert.AreEqual(p0, obj.GetRPN(input));
        }
예제 #2
0
        public void Given_numners_and_power_of_Should_Return_Total()
        {
            RPNCal obj      = new RPNCal();
            string expr     = "4,2,^";
            double expected = 16;
            double actual   = (double)obj.GetRPN(expr);

            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void Given_numners_and_persentagesign_and_plussign_Should_Return_Total()
        {
            RPNCal obj      = new RPNCal();
            string expr     = "20,25,+,100,%";
            double expected = 45;
            double actual   = (double)obj.GetRPN(expr);

            Assert.AreEqual(expected, actual);
        }
예제 #4
0
        public void Given_numners_and_minussign_Should_Return_Total()
        {
            RPNCal obj      = new RPNCal();
            string expr     = "2,2,5,1,+,5,3,-";
            double expected = 12;
            double actual   = (double)obj.GetRPN(expr);

            Assert.AreEqual(expected, actual);
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                RPNCal obj    = new RPNCal();
                int?   result = obj.GetRPN(inputRPN.Text);

                outputRPN.Text = result.ToString();
            }
        }
예제 #6
0
        public ActionResult RPN(FormCollection coll)
        {
            RPNCal obj      = new RPNCal();
            string inputVal = coll["rpnInput"];
            int?   result   = obj.GetRPN(inputVal);

            ViewBag.Message = result;

            return(View());
        }