Beispiel #1
0
 public void AdditionWithZeroTest()
 {
     calculator.AddNumber("5");
     calculator.AddOperation("+");
     calculator.AddNumber("0");
     calculator.Counting();
     Assert.AreEqual(5, Convert.ToDouble(calculator.CurrentEntry));
 }
Beispiel #2
0
 public void ClickOnThBackspaceButtonTest()
 {
     calculator.AddNumber("1");
     Assert.AreEqual("1", calculator.CurrentEntry);
     calculator.Backspace();
     Assert.AreEqual("", calculator.CurrentEntry);
 }
 /// <summary>
 /// Click a number buttonю
 /// </summary>
 /// <param name="sender">Clicked button</param>
 private void buttonNumber_Click(object sender, EventArgs e) => calculator.AddNumber((string)((Button)sender).Text);
 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);
 }