Skip to content

Commit

Permalink
Change test to try to get good coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Sébastien Murgey <sebastien.murgey@rte-france.com>
  • Loading branch information
murgeyseb committed Oct 18, 2023
1 parent b35ea00 commit 9a6fe5f
Showing 1 changed file with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,33 +140,19 @@ void testNetPositionIsZeroWhenDanglingLineBorderPIsNaN() {
}

@Test
void testNetPositionPartOfLineIsZeroWhenLineTerminal1PIsNaN() {
void testNetPositionPartOfLineIsZeroWhenLineIsDisconnected() {
Network network = Network.read("testCaseSpecialDevices.xiidm", getClass().getResourceAsStream("/testCaseSpecialDevices.xiidm"));
network.getLine("LINE_FR_ES").getTerminal1().setP(Double.NaN);
network.getLine("LINE_FR_ES").getTerminal1().disconnect();
network.getLine("LINE_FR_ES").getTerminal2().disconnect();
assertEquals(75, countryAreaFactoryFR.create(network).getNetPosition(), 1e-3);
assertEquals(-75, countryAreaFactoryES.create(network).getNetPosition(), 1e-3);
}

@Test
void testNetPositionPartOfLineIsZeroWhenLineTerminal2PIsNaN() {
void testNetPositionPartOfHvdcIsZeroWhenHvdcIsDisconnected() {
Network network = Network.read("testCaseSpecialDevices.xiidm", getClass().getResourceAsStream("/testCaseSpecialDevices.xiidm"));
network.getLine("LINE_FR_ES").getTerminal2().setP(Double.NaN);
assertEquals(75, countryAreaFactoryFR.create(network).getNetPosition(), 1e-3);
assertEquals(-75, countryAreaFactoryES.create(network).getNetPosition(), 1e-3);
}

@Test
void testNetPositionPartOfHvdcIsZeroWhenHvdcTerminal1PIsNaN() {
Network network = Network.read("testCaseSpecialDevices.xiidm", getClass().getResourceAsStream("/testCaseSpecialDevices.xiidm"));
network.getHvdcLine("HVDC_FR_ES").getConverterStation1().getTerminal().setP(Double.NaN);
assertEquals(75, countryAreaFactoryFR.create(network).getNetPosition(), 1e-3);
assertEquals(-75, countryAreaFactoryES.create(network).getNetPosition(), 1e-3);
}

@Test
void testNetPositionPartOfHvdcIsZeroWhenHvdcTerminal2PIsNaN() {
Network network = Network.read("testCaseSpecialDevices.xiidm", getClass().getResourceAsStream("/testCaseSpecialDevices.xiidm"));
network.getHvdcLine("HVDC_FR_ES").getConverterStation2().getTerminal().setP(Double.NaN);
network.getHvdcLine("HVDC_FR_ES").getConverterStation1().getTerminal().disconnect();
network.getHvdcLine("HVDC_FR_ES").getConverterStation2().getTerminal().disconnect();
assertEquals(75, countryAreaFactoryFR.create(network).getNetPosition(), 1e-3);
assertEquals(-75, countryAreaFactoryES.create(network).getNetPosition(), 1e-3);
}
Expand Down

0 comments on commit 9a6fe5f

Please sign in to comment.