Quellcode durchsuchen

hello-world: Modify tests to reject `name == ""` comparison (#280)

* hello-world: Modify tests to reject name == "" comparison

* hello-world: Add emptyStringIsComparedByValue() test case
Olga Traczyk vor 9 Jahren
Ursprung
Commit
03cf979f63
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6
    0
      exercises/hello-world/src/test/java/HelloWorldTest.java

+ 6
- 0
exercises/hello-world/src/test/java/HelloWorldTest.java Datei anzeigen

@@ -14,6 +14,12 @@ public class HelloWorldTest {
14 14
 
15 15
     @Test
16 16
     @Ignore
17
+    public void emptyStringIsComparedByValue() {
18
+        assertEquals("Hello, World!", HelloWorld.hello(new String("")));
19
+    }
20
+    
21
+    @Test
22
+    @Ignore
17 23
     public void helloSampleName() {
18 24
         assertEquals("Hello, Alice!", HelloWorld.hello("Alice"));
19 25
     }