Parcourir la source

Merge pull request #1232 from Zhiyuan-Amos/anagram-test

Anagram: Update tests and version
FridaTveit il y a 8 ans
Parent
révision
4f0350f143
Aucun compte lié à l'adresse email de l'auteur

+ 1
- 1
exercises/anagram/.meta/version Voir le fichier

1
-1.1.0
1
+1.2.0

+ 0
- 32
exercises/anagram/src/test/java/AnagramTest.java Voir le fichier

19
 
19
 
20
     @Ignore("Remove to run test")
20
     @Ignore("Remove to run test")
21
     @Test
21
     @Test
22
-    public void testDetectSimpleAnagram() {
23
-        Anagram detector = new Anagram("ant");
24
-        List<String> anagram = detector.match(Arrays.asList("tan", "stand", "at"));
25
-        assertThat(anagram, hasItem("tan"));
26
-        assertThat(anagram.size(), is(1));
27
-    }
28
-
29
-    @Ignore("Remove to run test")
30
-    @Test
31
-    public void testDoesNotConfuseDifferentDuplicates() {
32
-        Anagram detector = new Anagram("galea");
33
-        assertTrue(detector.match(Collections.singletonList("eagle")).isEmpty());
34
-    }
35
-
36
-    @Ignore("Remove to run test")
37
-    @Test
38
     public void testDetectMultipleAnagrams() {
22
     public void testDetectMultipleAnagrams() {
39
         Anagram detector = new Anagram("master");
23
         Anagram detector = new Anagram("master");
40
         List<String> anagrams = detector.match(Arrays.asList("stream", "pigeon", "maters"));
24
         List<String> anagrams = detector.match(Arrays.asList("stream", "pigeon", "maters"));
66
 
50
 
67
     @Ignore("Remove to run test")
51
     @Ignore("Remove to run test")
68
     @Test
52
     @Test
69
-    public void testIdenticalWordIsNotAnagram() {
70
-        Anagram detector = new Anagram("corn");
71
-        List<String> anagrams = detector.match(Arrays.asList("corn", "dark", "Corn", "rank", "CORN", "cron", "park"));
72
-        assertThat(anagrams, hasItem("cron"));
73
-        assertThat(anagrams.size(), is(1));
74
-    }
75
-
76
-    @Ignore("Remove to run test")
77
-    @Test
78
     public void testEliminateAnagramsWithSameChecksum() {
53
     public void testEliminateAnagramsWithSameChecksum() {
79
         Anagram detector = new Anagram("mass");
54
         Anagram detector = new Anagram("mass");
80
         assertTrue(detector.match(Collections.singletonList("last")).isEmpty());
55
         assertTrue(detector.match(Collections.singletonList("last")).isEmpty());
106
 
81
 
107
     @Ignore("Remove to run test")
82
     @Ignore("Remove to run test")
108
     @Test
83
     @Test
109
-    public void testWordIsNotItsOwnAnagram() {
110
-        Anagram detector = new Anagram("banana");
111
-        assertTrue(detector.match(Collections.singletonList("Banana")).isEmpty());
112
-    }
113
-
114
-    @Ignore("Remove to run test")
115
-    @Test
116
     public void testIdenticalWordRepeatedIsNotAnagram() {
84
     public void testIdenticalWordRepeatedIsNotAnagram() {
117
         Anagram detector = new Anagram("go");
85
         Anagram detector = new Anagram("go");
118
         assertTrue(detector.match(Collections.singletonList("go Go GO")).isEmpty());
86
         assertTrue(detector.match(Collections.singletonList("go Go GO")).isEmpty());