From d0ca2545fc6efbc6ee0723924ee53b78068c21f6 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Wed, 7 Feb 2024 11:50:21 +0100 Subject: [PATCH] test: added isNumber test --- .../java/org/example/AdministrationTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/test/java/org/example/AdministrationTest.java b/src/test/java/org/example/AdministrationTest.java index 8edf5c7..1875272 100644 --- a/src/test/java/org/example/AdministrationTest.java +++ b/src/test/java/org/example/AdministrationTest.java @@ -20,4 +20,27 @@ class AdministrationTest { } + + @Test + void isNumber() { + + Administration administration = new Administration(); + String full01 = "S1002"; + String str1 = full01.substring(1); + String full02 = "S100Z"; + String str2 = full02.substring(1); + String full03 = "P1004"; + String str3 = full03.substring(1); + + + boolean test01 = administration.isNumber(str1); + boolean test02 = administration.isNumber(str2); + boolean test03 = administration.isNumber(str3); + + assertEquals(true, test01); + assertEquals(false, test02); + assertEquals(true, test03); + + } + } \ No newline at end of file