10
10
11
11
public class SherLockAndCostTest {
12
12
13
- @ Test
14
- public void testPositiveIntegers () {
15
- List <Integer > inputList = Arrays .asList (1 , 2 , 3 , 4 , 5 );
16
- int result = SherLockAndCost .sherlockAndCostProblem (inputList );
17
- assertEquals (8 , result );
18
- }
19
-
20
- @ Test
21
- public void testNegativeInteger () {
22
- List <Integer > list = Arrays .asList (-1 , -2 , -3 , -4 , -5 );
23
- int result = SherLockAndCost .sherlockAndCostProblem (list );
24
- assertEquals (0 , result );
25
- }
26
-
27
- @ Test
28
- public void testMixedElements () {
29
- List <Integer > list = Arrays .asList (-1 , 1 );
30
- int result = SherLockAndCost .sherlockAndCostProblem (list );
31
- assertEquals (0 , result );
32
- }
33
-
34
- @ Test
35
- public void testEdge () {
36
- List <Integer > list = Arrays .asList (-1 , 2 , 3 , 4 , 5 );
37
- int result = SherLockAndCost .sherlockAndCostProblem (list );
38
- assertEquals (8 , result );
39
- }
40
-
41
- @ Test
42
- public void testNullElements () {
43
- List <Integer > list = Arrays .asList (null , null , null , null );
44
- assertThrows (NullPointerException .class , () -> SherLockAndCost .sherlockAndCostProblem (list ));
45
- }
46
-
47
- @ Test
48
- public void testEmptyList () {
49
- List <Integer > list = Arrays .asList ();
50
- int result = SherLockAndCost .sherlockAndCostProblem (list );
51
- assertEquals (0 , result );
52
- }
53
-
54
- @ Test
55
- public void testSingleFList () {
56
- List <Integer > list = Arrays .asList (500 );
57
- int result = SherLockAndCost .sherlockAndCostProblem (list );
58
- assertEquals (0 , result );
59
- }
13
+ @ Test
14
+ public void testPositiveIntegers () {
15
+ List <Integer > inputList = Arrays .asList (1 , 2 , 3 , 4 , 5 );
16
+ int result = SherLockAndCost .sherlockAndCostProblem (inputList );
17
+ assertEquals (8 , result );
18
+ }
19
+
20
+ @ Test
21
+ public void testNegativeInteger () {
22
+ List <Integer > list = Arrays .asList (-1 , -2 , -3 , -4 , -5 );
23
+ int result = SherLockAndCost .sherlockAndCostProblem (list );
24
+ assertEquals (0 , result );
25
+ }
26
+
27
+ @ Test
28
+ public void testMixedElements () {
29
+ List <Integer > list = Arrays .asList (-1 , 1 );
30
+ int result = SherLockAndCost .sherlockAndCostProblem (list );
31
+ assertEquals (0 , result );
32
+ }
33
+
34
+ @ Test
35
+ public void testEdge () {
36
+ List <Integer > list = Arrays .asList (-1 , 2 , 3 , 4 , 5 );
37
+ int result = SherLockAndCost .sherlockAndCostProblem (list );
38
+ assertEquals (8 , result );
39
+ }
40
+
41
+ @ Test
42
+ public void testNullElements () {
43
+ List <Integer > list = Arrays .asList (null , null , null , null );
44
+ assertThrows (NullPointerException .class , () -> SherLockAndCost .sherlockAndCostProblem (list ));
45
+ }
46
+
47
+ @ Test
48
+ public void testEmptyList () {
49
+ List <Integer > list = Arrays .asList ();
50
+ int result = SherLockAndCost .sherlockAndCostProblem (list );
51
+ assertEquals (0 , result );
52
+ }
53
+
54
+ @ Test
55
+ public void testSingleFList () {
56
+ List <Integer > list = Arrays .asList (500 );
57
+ int result = SherLockAndCost .sherlockAndCostProblem (list );
58
+ assertEquals (0 , result );
59
+ }
60
60
}
0 commit comments