/// <summary> /// Creates a series with the given colour and marker type, and ensures that the /// output series' marker fill and type match the given expected outputs. /// </summary> /// <param name="input">Marker type which the constructed apsim series should use.</param> /// <param name="inputColour">Colour of the apsim series.</param> /// <param name="expectedOutput">Expected marker type of the output oxyplot series.</param> /// <param name="expectedColour">Expected marker colour of the output oxyplot series.</param> private void TestMarker(MarkerType input, Color inputColour, OxyPlot.MarkerType expectedOutput, OxyColor expectedColour) { // Create an apsim series with the given inputs. IEnumerable <object> x = Enumerable.Empty <object>(); IEnumerable <object> y = Enumerable.Empty <object>(); Line line = new Line(LineType.None, LineThickness.Thin); Marker marker = new Marker(input, MarkerSize.Normal, 1); LineSeries inputSeries = new LineSeries("", inputColour, true, x, y, line, marker, "", ""); // Convert the series to an oxyplot series. Series output = exporter.Export(inputSeries, AxisLabelCollection.Empty()).Result; Assert.NotNull(output); Assert.True(output is OxyLineSeries); OxyLineSeries series = (OxyLineSeries)output; // Ensure that the oxyplot series' marker type and fill match the expected values. Assert.AreEqual(expectedOutput, series.MarkerType); Assert.AreEqual(expectedColour, series.MarkerFill); }
public void TestMarkerTypeConversion(MarkerType input, OxyPlot.MarkerType expectedOutput) { Assert.AreEqual(expectedOutput, input.ToOxyPlotMarkerType()); }