@@ -11,12 +11,10 @@ import edu.ie3.datamodel.io.naming.FileNamingStrategy
1111import edu.ie3.datamodel.io.source.csv.CsvDataSource
1212import edu.ie3.datamodel.models.profile.BdewStandardLoadProfile
1313import edu.ie3.datamodel.models.value.load.BdewLoadValues
14- import edu.ie3.util.TimeUtil
1514import spock.lang.Shared
1615import spock.lang.Specification
1716
1817import java.nio.file.Path
19- import java.time.ZonedDateTime
2018import java.util.function.Function
2119
2220class BdewLoadProfileTest extends Specification {
@@ -27,6 +25,12 @@ class BdewLoadProfileTest extends Specification {
2725 @Shared
2826 private BdewLoadProfileFactory factory = new BdewLoadProfileFactory ()
2927
28+ @Shared
29+ private List<String > keys = [' su' , ' tr' , ' wi' ]
30+
31+ @Shared
32+ private Map results = [:]
33+
3034 def setupSpec () {
3135 Path resourcePath = Path . of(" ." , " src" , " main" , " resources" , " load" )
3236 source = new CsvDataSource (" ," , resourcePath, new FileNamingStrategy ())
@@ -37,9 +41,6 @@ class BdewLoadProfileTest extends Specification {
3741 def data = read(BdewStandardLoadProfile . G0 )
3842
3943 when :
40- def keys = [' su' , ' tr' , ' wi' ]
41- def results = [:]
42-
4344 keys. each {
4445 key ->
4546 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -66,9 +67,6 @@ class BdewLoadProfileTest extends Specification {
6667 def data = read(BdewStandardLoadProfile . G1 )
6768
6869 when :
69- def keys = [' su' , ' tr' , ' wi' ]
70- def results = [:]
71-
7270 keys. each {
7371 key ->
7472 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -95,9 +93,6 @@ class BdewLoadProfileTest extends Specification {
9593 def data = read(BdewStandardLoadProfile . G2 )
9694
9795 when :
98- def keys = [' su' , ' tr' , ' wi' ]
99- def results = [:]
100-
10196 keys. each {
10297 key ->
10398 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -124,9 +119,6 @@ class BdewLoadProfileTest extends Specification {
124119 def data = read(BdewStandardLoadProfile . G3 )
125120
126121 when :
127- def keys = [' su' , ' tr' , ' wi' ]
128- def results = [:]
129-
130122 keys. each {
131123 key ->
132124 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -153,9 +145,6 @@ class BdewLoadProfileTest extends Specification {
153145 def data = read(BdewStandardLoadProfile . G4 )
154146
155147 when :
156- def keys = [' su' , ' tr' , ' wi' ]
157- def results = [:]
158-
159148 keys. each {
160149 key ->
161150 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -182,9 +171,6 @@ class BdewLoadProfileTest extends Specification {
182171 def data = read(BdewStandardLoadProfile . G5 )
183172
184173 when :
185- def keys = [' su' , ' tr' , ' wi' ]
186- def results = [:]
187-
188174 keys. each {
189175 key ->
190176 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -211,9 +197,6 @@ class BdewLoadProfileTest extends Specification {
211197 def data = read(BdewStandardLoadProfile . G6 )
212198
213199 when :
214- def keys = [' su' , ' tr' , ' wi' ]
215- def results = [:]
216-
217200 keys. each {
218201 key ->
219202 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -240,9 +223,6 @@ class BdewLoadProfileTest extends Specification {
240223 def data = read(BdewStandardLoadProfile . H0 )
241224
242225 when :
243- def keys = [' su' , ' tr' , ' wi' ]
244- def results = [:]
245-
246226 keys. each {
247227 key ->
248228 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -264,7 +244,7 @@ class BdewLoadProfileTest extends Specification {
264244 results[" wiWd" ] == 10223.7
265245 }
266246
267- def " The BDEW dynamization function for the profile H= should work as expected" () {
247+ def " The BDEW dynamization function for the profile H0 should work as expected" () {
268248 when :
269249 def dynamizedValue = BdewLoadValues . dynamization(value, dayOfTheYear)
270250
@@ -283,9 +263,6 @@ class BdewLoadProfileTest extends Specification {
283263 def data = read(BdewStandardLoadProfile . L0 )
284264
285265 when :
286- def keys = [' su' , ' tr' , ' wi' ]
287- def results = [:]
288-
289266 keys. each {
290267 key ->
291268 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -312,9 +289,6 @@ class BdewLoadProfileTest extends Specification {
312289 def data = read(BdewStandardLoadProfile . L1 )
313290
314291 when :
315- def keys = [' su' , ' tr' , ' wi' ]
316- def results = [:]
317-
318292 keys. each {
319293 key ->
320294 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
@@ -341,9 +315,6 @@ class BdewLoadProfileTest extends Specification {
341315 def data = read(BdewStandardLoadProfile . L2 )
342316
343317 when :
344- def keys = [' su' , ' tr' , ' wi' ]
345- def results = [:]
346-
347318 keys. each {
348319 key ->
349320 results[" ${ key} Sa" ] = sumValues(data, v -> v. " ${ key} Sa" )
0 commit comments