-
Notifications
You must be signed in to change notification settings - Fork 5
/
BmInputTest.groovy
39 lines (33 loc) · 1.31 KB
/
BmInputTest.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
36
37
38
39
/*
* © 2021. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.models.input.system
import static edu.ie3.util.quantities.PowerSystemUnits.EURO_PER_MEGAWATTHOUR
import edu.ie3.test.common.SystemParticipantTestData
import spock.lang.Specification
import tech.units.indriya.quantity.Quantities
class BmInputTest extends Specification {
def "A BmInput copy method should work as expected"() {
given:
def bmInput = SystemParticipantTestData.bmInput
when:
def alteredUnit = bmInput.copy().type(SystemParticipantTestData.bmTypeInput)
.marketReaction(true)
.costControlled(true).feedInTariff(Quantities.getQuantity(15, EURO_PER_MEGAWATTHOUR)).build()
then:
alteredUnit.with {
assert uuid == bmInput.uuid
assert operationTime == bmInput.operationTime
assert operator == bmInput.operator
assert id == bmInput.id
assert marketReaction
assert costControlled
assert qCharacteristics == bmInput.qCharacteristics
assert feedInTariff == Quantities.getQuantity(15, EURO_PER_MEGAWATTHOUR)
assert type == SystemParticipantTestData.bmTypeInput
assert em == Optional.of(SystemParticipantTestData.emInput)
}
}
}