|
| 1 | +/** |
| 2 | + * Copyright (c) 2023, RTE (http://www.rte-france.com) |
| 3 | + * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | + * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | + * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 | + * SPDX-License-Identifier: MPL-2.0 |
| 7 | + */ |
| 8 | +package com.powsybl.nad.svg; |
| 9 | + |
| 10 | +import com.powsybl.iidm.network.Network; |
| 11 | +import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; |
| 12 | +import com.powsybl.nad.AbstractTest; |
| 13 | +import com.powsybl.nad.layout.LayoutParameters; |
| 14 | +import com.powsybl.nad.svg.iidm.DefaultLabelProvider; |
| 15 | +import com.powsybl.nad.svg.iidm.NominalVoltageStyleProvider; |
| 16 | +import org.junit.jupiter.api.BeforeEach; |
| 17 | +import org.junit.jupiter.api.Test; |
| 18 | + |
| 19 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 20 | + |
| 21 | +/** |
| 22 | + * @author Sophie Frasnedo <sophie.frasnedo at rte-france.com> |
| 23 | + */ |
| 24 | +class TieLineTest extends AbstractTest { |
| 25 | + |
| 26 | + @BeforeEach |
| 27 | + void setup() { |
| 28 | + setLayoutParameters(new LayoutParameters()); |
| 29 | + setSvgParameters(new SvgParameters() |
| 30 | + .setSvgWidthAndHeightAdded(true) |
| 31 | + .setFixedWidth(800)); |
| 32 | + } |
| 33 | + |
| 34 | + @Override |
| 35 | + protected StyleProvider getStyleProvider(Network network) { |
| 36 | + return new NominalVoltageStyleProvider(network); |
| 37 | + } |
| 38 | + |
| 39 | + @Override |
| 40 | + protected LabelProvider getLabelProvider(Network network) { |
| 41 | + return new DefaultLabelProvider(network, getSvgParameters()) { |
| 42 | + }; |
| 43 | + } |
| 44 | + |
| 45 | + @Test |
| 46 | + void testTieLine() { |
| 47 | + Network network = EurostagTutorialExample1Factory.createWithTieLine(); |
| 48 | + assertEquals(toString("/tie_line.svg"), generateSvgString(network, "/tie_line.svg")); |
| 49 | + } |
| 50 | + |
| 51 | +} |
0 commit comments