Skip to content

Conversation

ne0ds
Copy link
Contributor

@ne0ds ne0ds commented Jan 15, 2024

No description provided.

Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
David SARTORI added 3 commits January 17, 2024 18:08
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Comment on lines 140 to 154
var network = mock(Network.class);
var context = mock(ShortCircuitRunContext.class);
var busbarSection = mock(BusbarSection.class);
var terminal = mock(Terminal.class);
var busView = mock(BusView.class);
var busId = "bus1";

when(context.getBusId()).thenReturn(busId);
doReturn(busbarSection).when(network).getIdentifiable(busId);
when(busbarSection.getTerminal()).thenReturn(terminal);
when(terminal.getBusView()).thenReturn(busView);
when(busView.getBus()).thenReturn(null);

var exception = (ShortCircuitException) catchRuntimeException(() -> workerService.getBusFaultFromBusId(network, context));
assertThat(exception.getType()).isEqualTo(BUS_OUT_OF_VOLTAGE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@etiennehomer
I'm not sure we should use "var", what do you think ?
In such a small scope, I guess it's ok

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes why not in a small test method like this

Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
@ne0ds ne0ds requested a review from klesaulnier January 22, 2024 15:59
David SARTORI added 2 commits January 22, 2024 17:40
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
@ne0ds ne0ds requested a review from etiennehomer January 22, 2024 16:54
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Signed-off-by: David SARTORI <david.sartori_externe@rte-france.com>
Copy link

@ne0ds ne0ds merged commit 3cc8f71 into main Jan 24, 2024
@ne0ds ne0ds deleted the clean-out-of-voltage-bus-handling branch January 24, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants