public void ThenOutput(int p0) { //ScenarioContext.Current.Pending(); RPNCal obj = new RPNCal(); Assert.AreEqual(p0, obj.GetRPN(input)); }
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); }
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); }
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); }
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(); } }
public ActionResult RPN(FormCollection coll) { RPNCal obj = new RPNCal(); string inputVal = coll["rpnInput"]; int? result = obj.GetRPN(inputVal); ViewBag.Message = result; return(View()); }