public void AdditionWithZeroTest() { calculator.AddNumber("5"); calculator.AddOperation("+"); calculator.AddNumber("0"); calculator.Counting(); Assert.AreEqual(5, Convert.ToDouble(calculator.CurrentEntry)); }
public void ClickOnTheBackspaceButtonAfterCountingTest() { calculator.AddNumber("5"); calculator.AddOperation("+"); calculator.AddNumber("3"); calculator.Counting(); calculator.Backspace(); Assert.AreEqual("", calculator.CurrentEntry); }
public void ExpressionWithAdditionAndClickClearEntryButtonTest() { calculator.AddNumber("5"); calculator.AddComma(); calculator.AddNumber("2"); calculator.AddOperation("+"); calculator.AddNumber("1"); calculator.AddComma(); calculator.AddNumber("1"); calculator.Counting(); Assert.AreEqual(6, 3, Convert.ToDouble(calculator.CurrentEntry)); calculator.ClearEntry(); Assert.AreEqual("", calculator.CurrentEntry); Assert.AreEqual("", calculator.CurrentExpression); }
/// <summary> /// Click operation button. /// </summary> private void buttonOperation_Click(object sender, EventArgs e) => calculator.AddOperation((string)((Button)sender).Text);