@@ -36,35 +36,35 @@ class ForLoopUnitTest {
36
36
// givenXXX_whenYYY_thenZZZ or whenXXX_thenYYY
37
37
38
38
@ Test
39
- def gevenInclusiveRange_whenForLoop_thenIterateOverEachElement (): Unit = {
39
+ def givenInclusiveRange_whenForLoop_thenIterateOverEachElement (): Unit = {
40
40
forLoopTest.iterateRangeTo(rangeTo)
41
41
val expected = Seq (1 , 2 , 3 )
42
42
assertEquals(expected, forLoopTest.sideEffectResult)
43
43
}
44
44
45
45
@ Test
46
- def gevenExclusiveRange_whenForLoop_thenIterateOverEachElement (): Unit = {
46
+ def givenExclusiveRange_whenForLoop_thenIterateOverEachElement (): Unit = {
47
47
forLoopTest.iterateRangeUntil(rangeUntil)
48
48
val expected = Seq (1 , 2 )
49
49
assertEquals(expected, forLoopTest.sideEffectResult)
50
50
}
51
51
52
52
@ Test
53
- def gevenExclusiveAndInclusiveRange_whenForLoopWithMltipleGenerators_thenCartesianProduct (): Unit = {
53
+ def givenExclusiveAndInclusiveRange_whenForLoopWithMltipleGenerators_thenCartesianProduct (): Unit = {
54
54
forLoopTest.multipleGenerators(rangeTo, rangeUntil)
55
55
val expected = Seq (" 1, 1" , " 1, 2" , " 2, 1" , " 2, 2" , " 3, 1" , " 3, 2" )
56
56
assertEquals(expected, forLoopTest.sideEffectResult)
57
57
}
58
58
59
59
@ Test
60
- def gevenCollection_whenForLoop_thenIterateOverEachElement (): Unit = {
60
+ def givenCollection_whenForLoop_thenIterateOverEachElement (): Unit = {
61
61
forLoopTest.iterateCollection(colors)
62
62
val expected = Seq (" R" , " G" , " B" )
63
63
assertEquals(expected, forLoopTest.sideEffectResult)
64
64
}
65
65
66
66
@ Test
67
- def gevenCollection_whenForLoopWithMltipleGenerators_thenAllPossibleCombinations (): Unit = {
67
+ def givenCollection_whenForLoopWithMltipleGenerators_thenAllPossibleCombinations (): Unit = {
68
68
forLoopTest.iterateCollectionWithMultipleGenerators(colors)
69
69
val expected = List (" RRR " , " RRG " , " RRB " , " RGR " , " RGG " , " RGB " , " RBR " , " RBG " , " RBB " ,
70
70
" GRR " , " GRG " , " GRB " , " GGR " , " GGG " , " GGB " , " GBR " , " GBG " , " GBB " ,
@@ -73,35 +73,35 @@ class ForLoopUnitTest {
73
73
}
74
74
75
75
@ Test
76
- def gevenCollection_whenForLoopWithMltipleGeneratorsAndGuards_thenUniqueLettersCombinations (): Unit = {
76
+ def givenCollection_whenForLoopWithMltipleGeneratorsAndGuards_thenUniqueLettersCombinations (): Unit = {
77
77
forLoopTest.iterateCollectionsWithGuards(colors)
78
78
val expected = List (" RGB " , " RBG " , " GRB " , " GBR " , " BRG " , " BGR " )
79
79
assertEquals(expected, forLoopTest.sideEffectResult)
80
80
}
81
81
82
82
@ Test
83
- def gevenMap_whenForLoop_thenCollectionOfStrings (): Unit = {
83
+ def givenMap_whenForLoop_thenCollectionOfStrings (): Unit = {
84
84
forLoopTest.iterateMap(map)
85
85
val expected = List (" R is for Red" , " G is for Green" , " B is for Blue" )
86
86
assertEquals(expected, forLoopTest.sideEffectResult)
87
87
}
88
88
89
89
@ Test
90
- def gevenMap_whenForLoopWithMltipleGenerators_thenAllCombinationsOfKeyAndValueList (): Unit = {
90
+ def givenMap_whenForLoopWithMltipleGenerators_thenAllCombinationsOfKeyAndValueList (): Unit = {
91
91
forLoopTest.iterateMapMultipleGenerators(deck)
92
92
val expected = List (" A of ♣" , " K of ♣" , " Q of ♣" , " J of ♦" , " 10 of ♦" , " 9 of ♥" , " 8 of ♥" , " 7 of ♥" , " A of ♠" , " K of ♠" , " J of ♠" , " 6 of ♠" )
93
93
assertEquals(expected, forLoopTest.sideEffectResult)
94
94
}
95
95
96
96
@ Test
97
- def gevenCollection_whenForComprehension_thenReturnedCollectionOfStrings (): Unit = {
97
+ def givenCollection_whenForComprehension_thenReturnedCollectionOfStrings (): Unit = {
98
98
val result = forLoopTest.pureIteration(numbers)
99
99
val expected = List (" 1 + 1 = 2" , " 2 + 2 = 4" , " 3 + 3 = 6" )
100
100
assertEquals(expected, result)
101
101
}
102
102
103
103
@ Test
104
- def gevenOptionals_whenForComprehensionOrMap_thenReturnedOptional (): Unit = {
104
+ def givenOptionals_whenForComprehensionOrMap_thenReturnedOptional (): Unit = {
105
105
106
106
val resultFor = forLoopTest.forComprehensionWithOptionals(someIntValue, someStringValue)
107
107
val resultMap = forLoopTest.mapOptionals(someIntValue, someStringValue)
0 commit comments