Преглед изворни кода

binary-search: rename variable

MichaelSpets пре 9 година
родитељ
комит
ff294a9980
1 измењених фајлова са 20 додато и 20 уклоњено
  1. 20
    20
      exercises/binary-search/src/test/java/BinarySearchTest.java

+ 20
- 20
exercises/binary-search/src/test/java/BinarySearchTest.java Прегледај датотеку

15
     public void findsAValueInAnArrayWithOneElement() {
15
     public void findsAValueInAnArrayWithOneElement() {
16
         List<Integer> listOfUnitLength = Collections.singletonList(6);
16
         List<Integer> listOfUnitLength = Collections.singletonList(6);
17
 
17
 
18
-        BinarySearch<Integer> sut = new BinarySearch<>(listOfUnitLength);
18
+        BinarySearch<Integer> search = new BinarySearch<>(listOfUnitLength);
19
 
19
 
20
-        assertEquals(0, sut.indexOf(6));
20
+        assertEquals(0, search.indexOf(6));
21
     }
21
     }
22
 
22
 
23
     @Ignore("Remove to run test")
23
     @Ignore("Remove to run test")
27
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
27
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
28
         );
28
         );
29
 
29
 
30
-        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
30
+        BinarySearch<Integer> search = new BinarySearch<>(sortedList);
31
 
31
 
32
-        assertEquals(3, sut.indexOf(6));
32
+        assertEquals(3, search.indexOf(6));
33
     }
33
     }
34
 
34
 
35
     @Ignore("Remove to run test")
35
     @Ignore("Remove to run test")
39
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
39
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
40
         );
40
         );
41
 
41
 
42
-        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
42
+        BinarySearch<Integer> search = new BinarySearch<>(sortedList);
43
 
43
 
44
-        assertEquals(0, sut.indexOf(1));
44
+        assertEquals(0, search.indexOf(1));
45
     }
45
     }
46
 
46
 
47
     @Ignore("Remove to run test")
47
     @Ignore("Remove to run test")
51
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
51
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
52
         );
52
         );
53
 
53
 
54
-        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
54
+        BinarySearch<Integer> search = new BinarySearch<>(sortedList);
55
 
55
 
56
-        assertEquals(6, sut.indexOf(11));
56
+        assertEquals(6, search.indexOf(11));
57
     }
57
     }
58
 
58
 
59
     @Ignore("Remove to run test")
59
     @Ignore("Remove to run test")
63
                 Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634)
63
                 Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634)
64
         );
64
         );
65
 
65
 
66
-        BinarySearch<Integer> sut = new BinarySearch<>(sortedListOfOddLength);
66
+        BinarySearch<Integer> search = new BinarySearch<>(sortedListOfOddLength);
67
 
67
 
68
-        assertEquals(9, sut.indexOf(144));
68
+        assertEquals(9, search.indexOf(144));
69
     }
69
     }
70
 
70
 
71
     @Ignore("Remove to run test")
71
     @Ignore("Remove to run test")
75
                 Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377)
75
                 Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377)
76
         );
76
         );
77
 
77
 
78
-        BinarySearch<Integer> sut = new BinarySearch<>(sortedListOfEvenLength);
78
+        BinarySearch<Integer> search = new BinarySearch<>(sortedListOfEvenLength);
79
 
79
 
80
-        assertEquals(5, sut.indexOf(21));
80
+        assertEquals(5, search.indexOf(21));
81
     }
81
     }
82
 
82
 
83
     @Ignore("Remove to run test")
83
     @Ignore("Remove to run test")
87
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
87
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
88
         );
88
         );
89
 
89
 
90
-        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
90
+        BinarySearch<Integer> search = new BinarySearch<>(sortedList);
91
 
91
 
92
-        assertEquals(-1, sut.indexOf(7));
92
+        assertEquals(-1, search.indexOf(7));
93
     }
93
     }
94
 
94
 
95
     @Ignore("Remove to run test")
95
     @Ignore("Remove to run test")
99
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
99
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
100
         );
100
         );
101
 
101
 
102
-        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
102
+        BinarySearch<Integer> search = new BinarySearch<>(sortedList);
103
 
103
 
104
-        assertEquals(-1, sut.indexOf(0));
104
+        assertEquals(-1, search.indexOf(0));
105
     }
105
     }
106
 
106
 
107
     @Ignore("Remove to run test")
107
     @Ignore("Remove to run test")
111
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
111
                 Arrays.asList(1, 3, 4, 6, 8, 9, 11)
112
         );
112
         );
113
 
113
 
114
-        BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
114
+        BinarySearch<Integer> search = new BinarySearch<>(sortedList);
115
 
115
 
116
-        assertEquals(-1, sut.indexOf(13));
116
+        assertEquals(-1, search.indexOf(13));
117
     }
117
     }
118
 
118
 
119
     @Ignore("Remove to run test")
119
     @Ignore("Remove to run test")
121
     public void nothingIsIncludedInAnEmptyArray() {
121
     public void nothingIsIncludedInAnEmptyArray() {
122
         List<Integer> emptyList = Collections.emptyList();
122
         List<Integer> emptyList = Collections.emptyList();
123
 
123
 
124
-        BinarySearch<Integer> sut = new BinarySearch<>(emptyList);
124
+        BinarySearch<Integer> search = new BinarySearch<>(emptyList);
125
 
125
 
126
-        assertEquals(-1, sut.indexOf(1));
126
+        assertEquals(-1, search.indexOf(1));
127
     }
127
     }
128
 }
128
 }