Search in sources :

Example 26 with Axes

use of net.sf.latexdraw.model.api.shape.Axes in project latexdraw by arnobl.

the class TestParsingPsaxes method testTickStyle.

@ParameterizedTest
@EnumSource(value = PlottingStyle.class)
public void testTickStyle(final PlottingStyle style) {
    parser("\\psaxes[ticks=" + style.getPSTToken() + "](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(style, axes.getTicksDisplayed());
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 27 with Axes

use of net.sf.latexdraw.model.api.shape.Axes in project latexdraw by arnobl.

the class TestParsingPsaxes method testTickStyle.

@ParameterizedTest
@EnumSource(value = TicksStyle.class)
public void testTickStyle(final TicksStyle style) {
    parser("\\psaxes[tickstyle=" + style.getPSTToken() + "](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(style, axes.getTicksStyle());
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 28 with Axes

use of net.sf.latexdraw.model.api.shape.Axes in project latexdraw by arnobl.

the class TestParsingPsaxes method testParamdy.

@ParameterizedTest
@ValueSource(doubles = { 2d, 3.5 })
public void testParamdy(final double dy) {
    parser("\\psaxes[dy=" + dy + " cm](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(dy, axes.getDistLabelsY(), 0.00001);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 29 with Axes

use of net.sf.latexdraw.model.api.shape.Axes in project latexdraw by arnobl.

the class TestParsingPsaxes method testShowOrigin.

@Test
public void testShowOrigin() {
    parser("\\psaxes[showorigin=true](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertTrue(axes.isShowOrigin());
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 30 with Axes

use of net.sf.latexdraw.model.api.shape.Axes in project latexdraw by arnobl.

the class TestParsingPsaxes method testParamdx.

@ParameterizedTest
@ValueSource(doubles = { 2d, 3.5 })
public void testParamdx(final double dx) {
    parser("\\psaxes[dx=" + dx + " cm](0,0)(0,0)(2,2)");
    final Axes axes = getShapeAt(0);
    assertEquals(dx, axes.getDistLabelsX(), 0.00001);
}
Also used : Axes(net.sf.latexdraw.model.api.shape.Axes) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

Axes (net.sf.latexdraw.model.api.shape.Axes)40 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)28 Test (org.junit.Test)8 EnumSource (org.junit.jupiter.params.provider.EnumSource)8 MethodSource (org.junit.jupiter.params.provider.MethodSource)8 HelperTest (net.sf.latexdraw.HelperTest)7 ArrowableSingleShape (net.sf.latexdraw.model.api.shape.ArrowableSingleShape)7 ValueSource (org.junit.jupiter.params.provider.ValueSource)6 Shape (net.sf.latexdraw.model.api.shape.Shape)5 Test (org.junit.jupiter.api.Test)5 Dot (net.sf.latexdraw.model.api.shape.Dot)3 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)3 Collections (java.util.Collections)2 ShapeData (net.sf.latexdraw.data.ShapeData)2 ShapeFactory (net.sf.latexdraw.model.ShapeFactory)2 ArrowStyle (net.sf.latexdraw.model.api.shape.ArrowStyle)2 AxesStyle (net.sf.latexdraw.model.api.shape.AxesStyle)2 BorderPos (net.sf.latexdraw.model.api.shape.BorderPos)2 DotStyle (net.sf.latexdraw.model.api.shape.DotStyle)2 FillingStyle (net.sf.latexdraw.model.api.shape.FillingStyle)2