From da2478e2e84c7b6e68715c98e6c8a39e20125736 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Mon, 15 Jun 2015 14:56:54 +0200 Subject: Make CLX enter newNumber before clear and add TestCase for that --- test/gui/CalculatorTest.java | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'test/gui/CalculatorTest.java') diff --git a/test/gui/CalculatorTest.java b/test/gui/CalculatorTest.java index 77d3371..98c6516 100644 --- a/test/gui/CalculatorTest.java +++ b/test/gui/CalculatorTest.java @@ -15,6 +15,7 @@ import static org.loadui.testfx.Assertions.verifyThat; import static org.loadui.testfx.controls.Commons.hasText; import java.io.IOException; + import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.control.Button; @@ -29,9 +30,8 @@ public class CalculatorTest extends GuiTest { try { - return FXMLLoader - .load(CalculatorTest.class - .getResource("/de/fhswf/in/inf/upnfx/view/MainView.fxml")); + return FXMLLoader.load(CalculatorTest.class + .getResource("/de/fhswf/in/inf/upnfx/view/MainView.fxml")); } catch (IOException e) { @@ -44,21 +44,44 @@ public class CalculatorTest extends GuiTest { Button button = find("#0"); click(button); - button = find("#0"); click(button); button = find("#,"); click(button); - button = find("#,"); click(button); button = find("#0"); click(button); - button = find("#0"); click(button); button = find("#1"); click(button); verifyThat("#display", hasText("0.001")); } + @Test + public void testClx() + { + Button button = find("#1"); + click(button); + button = find("#2"); + click(button); + button = find("#3"); + click(button); + button = find("#ENT"); + click(button); + verifyThat("#display", hasText("123.0")); + button = find("#4"); + click(button); + button = find("#5"); + click(button); + button = find("#6"); + click(button); + verifyThat("#display", hasText("456")); + button = find("#CLX"); + click(button); + verifyThat("#display", hasText("123.0")); + click(button); + verifyThat("#display", hasText("")); + } + @Test public void testNumbers() { -- cgit v1.2.3-70-g09d2