Skip to content

Commit

Permalink
Add small test.
Browse files Browse the repository at this point in the history
Signed-off-by: Bertrand Rix <bertrand.rix@artelys.com>
  • Loading branch information
obrix committed Sep 27, 2023
1 parent 1ef6f55 commit 16c27ba
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package com.powsybl.iidm.network.tck;

import com.google.common.collect.Iterables;
import com.powsybl.commons.PowsyblException;
import com.powsybl.iidm.network.*;
import com.powsybl.iidm.network.PhaseTapChanger.RegulationMode;
import com.powsybl.iidm.network.ThreeWindingsTransformer.Leg;
Expand Down Expand Up @@ -987,6 +988,19 @@ public void validLeg3Arguments() {
createThreeWindingsTransformerWithLeg3(1.3, 2.3, 3.3, 4.3, 5.3);
}

@Test
public void threeSidesTest() {
assertEquals(ThreeSides.ONE, ThreeSides.valueOf(1));
assertEquals(ThreeSides.TWO, ThreeSides.valueOf(2));
assertEquals(ThreeSides.THREE, ThreeSides.valueOf(3));

assertEquals(1, ThreeSides.ONE.getNum());
assertEquals(2, ThreeSides.TWO.getNum());
assertEquals(3, ThreeSides.THREE.getNum());

assertThrows(PowsyblException.class, () -> ThreeSides.valueOf(4));
}

private void createThreeWindingsTransformerWithLeg3(double r, double x, double g, double b, double ratedU) {
substation.newThreeWindingsTransformer()
.setId("twt")
Expand Down

0 comments on commit 16c27ba

Please sign in to comment.