예제 #1
0
 public void ClickOnTheClearEntryButtonBeforeAddOperationTest()
 {
     for (int i = 0; i < 5; i++)
     {
         calculator.AddNumber("1");
     }
     Assert.AreEqual("11111", calculator.CurrentEntry);
     calculator.ClearEntry();
     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 delete entry button.
 /// </summary>
 private void buttonDeleteEntry_Click(object sender, EventArgs e) => calculator.ClearEntry();