-
Notifications
You must be signed in to change notification settings - Fork 5
/
CsvJointGridContainerSourceTest.groovy
35 lines (29 loc) · 1.3 KB
/
CsvJointGridContainerSourceTest.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* © 2023. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.io.source.csv
import spock.lang.Specification
class CsvJointGridContainerSourceTest extends Specification implements CsvTestDataMeta {
def "The CsvJointGridContainer is able to read a grid with flat structure"() {
when:
def gridName = "vn_simona"
def separator = ","
def inputGridContainer = CsvJointGridContainerSource.read(gridName, separator, jointGridFolderPath, false)
then:
inputGridContainer.getGraphics().allEntitiesAsList().size() == 590
inputGridContainer.getSystemParticipants().allEntitiesAsList().size() == 566
inputGridContainer.getRawGrid().allEntitiesAsList().size() == 898
}
def "The CsvJointGridContainer is able to read a grid with hierarchic structure"() {
when:
def gridName = "vn_simona"
def separator = ";"
def inputGridContainer = CsvJointGridContainerSource.read(gridName, separator, hierarchicGridFolderPath, true)
then:
inputGridContainer.getGraphics().allEntitiesAsList().size() == 0
inputGridContainer.getSystemParticipants().allEntitiesAsList().size() == 198
inputGridContainer.getRawGrid().allEntitiesAsList().size() == 202
}
}