From 38a8bea237e8c6b43f05fb3ca7dd22a11fedc71e Mon Sep 17 00:00:00 2001 From: Henry LaFleur Date: Wed, 1 Oct 2025 16:29:33 -0500 Subject: [PATCH 1/5] Add projects, solution, and NuGet for OxyPlot WPF --- .../ExampleLibrary/ExampleLibrary.core.csproj | 34 +++++ .../Properties/Resources.Designer.cs | 2 +- .../Properties/Settings.Designer.cs | 2 +- .../Examples/LegendsDemo/MainViewModel.cs | 5 +- .../Examples/LegendsDemo/MainWindow.xaml | 2 +- .../Properties/Resources.Designer.cs | 2 +- .../Properties/Settings.Designer.cs | 2 +- .../WPF/WpfExamples/WpfExamples.core.csproj | 85 ++++++++++++ .../OxyPlot.OpenXml.core.csproj | 43 +++++++ .../Properties/AssemblyInfo.cs | 3 - .../Reporting/WordDocumentReportWriter.cs | 4 +- Source/OxyPlot.Pdf/OxyPlot.Pdf.core.csproj | 39 ++++++ Source/OxyPlot.Pdf/PdfRenderContext.cs | 10 +- Source/OxyPlot.Pdf/Properties/AssemblyInfo.cs | 3 - Source/OxyPlot.Tests/Axes/AxisTests.cs | 15 +-- .../OxyPlot.Tests/Axes/AxisUtilitiesTests.cs | 2 +- .../OxyPlot.Tests/Axes/DateTimeAxisTests.cs | 24 ++-- Source/OxyPlot.Tests/Axes/LinearAxisTests.cs | 17 ++- .../CohenSutherlandClippingTests.cs | 31 ++--- .../Foundation/DataPointTests.cs | 17 +-- .../OxyPlot.Tests/Foundation/OxyColorTests.cs | 48 +++---- .../Foundation/OxyPaletteTests.cs | 18 +-- .../Foundation/RenderingExtensionsTests.cs | 17 ++- .../Foundation/ScreenPointHelperTests.cs | 12 +- .../SutherlandHodgmanClippingTests.cs | 6 +- .../Imaging/Deflate/DeflateTests.cs | 8 +- .../Imaging/Deflate/NayukiDeflateTests.cs | 59 +++++---- .../Imaging/Png/PngDecoderTests.cs | 12 +- .../Imaging/TestImages/OxyImageTests.cs | 14 +- Source/OxyPlot.Tests/OxyAssert.cs | 7 +- .../OxyPlot.Tests/OxyPlot.Tests.core.csproj | 72 +++++++++++ Source/OxyPlot.Tests/OxyPlot.Tests.csproj | 121 +++--------------- Source/OxyPlot.Tests/Pdf/PdfExporterTests.cs | 4 +- .../Pdf/PortableDocumentTests.cs | 12 +- .../PlotController/PlotControllerTests.cs | 10 +- .../OxyPlot.Tests/PlotModel/PlotModelTests.cs | 18 ++- .../Rendering/Utilities/DecimatorTests.cs | 6 +- Source/OxyPlot.Tests/Svg/SvgExporterTests.cs | 7 +- .../Utilities/ArrayBuilderTests.cs | 52 ++++---- Source/OxyPlot.Tests/Utilities/ConrecTests.cs | 6 +- .../Utilities/FractionHelperTests.cs | 8 +- .../Utilities/ListFillerTests.cs | 24 ++-- .../Utilities/StringHelperTests.cs | 14 +- .../OxyPlot.Wpf.Tests/Axes/LinearAxisTests.cs | 19 +-- Source/OxyPlot.Wpf.Tests/OxyAssert.cs | 8 +- .../OxyPlot.Wpf.Tests.core.csproj | 48 +++++++ Source/OxyPlot.Wpf.Tests/PlotViewTests.cs | 12 +- Source/OxyPlot.Wpf.Tests/PngAssert.cs | 12 +- Source/OxyPlot.Wpf.Tests/PngExporterTests.cs | 9 +- .../Properties/AssemblyInfo.cs | 8 +- Source/OxyPlot.Wpf/OxyPlot.Wpf.core.csproj | 57 +++++++++ .../Properties/Resources.Designer.cs | 2 +- .../Properties/Settings.Designer.cs | 2 +- Source/OxyPlot.Xps/OxyPlot.Xps.core.csproj | 41 ++++++ Source/OxyPlot.core.sln | 82 ++++++++++++ .../OxyPlot/Graphics/ElementCollection{T}.cs | 6 + Source/OxyPlot/Imaging/Jpeg/JpegDecoder.cs | 7 +- Source/OxyPlot/OxyPlot.core.csproj | 21 +++ 58 files changed, 834 insertions(+), 397 deletions(-) create mode 100644 Source/Examples/ExampleLibrary/ExampleLibrary.core.csproj create mode 100644 Source/Examples/WPF/WpfExamples/WpfExamples.core.csproj create mode 100644 Source/OxyPlot.OpenXml/OxyPlot.OpenXml.core.csproj create mode 100644 Source/OxyPlot.Pdf/OxyPlot.Pdf.core.csproj create mode 100644 Source/OxyPlot.Tests/OxyPlot.Tests.core.csproj create mode 100644 Source/OxyPlot.Wpf.Tests/OxyPlot.Wpf.Tests.core.csproj create mode 100644 Source/OxyPlot.Wpf/OxyPlot.Wpf.core.csproj create mode 100644 Source/OxyPlot.Xps/OxyPlot.Xps.core.csproj create mode 100644 Source/OxyPlot.core.sln create mode 100644 Source/OxyPlot/OxyPlot.core.csproj diff --git a/Source/Examples/ExampleLibrary/ExampleLibrary.core.csproj b/Source/Examples/ExampleLibrary/ExampleLibrary.core.csproj new file mode 100644 index 000000000..be3111206 --- /dev/null +++ b/Source/Examples/ExampleLibrary/ExampleLibrary.core.csproj @@ -0,0 +1,34 @@ + + + + netstandard2.0 + 10.0.0 + ExampleLibrary + ExampleLibrary + {FACB89E5-53A5-4748-9F5B-E0714EBB37B2} + false + + + true + + + ExampleLibrary.snk + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + + + + + + + + + diff --git a/Source/Examples/WPF/ExampleBrowser/Properties/Resources.Designer.cs b/Source/Examples/WPF/ExampleBrowser/Properties/Resources.Designer.cs index 057ea972c..9334dba36 100644 --- a/Source/Examples/WPF/ExampleBrowser/Properties/Resources.Designer.cs +++ b/Source/Examples/WPF/ExampleBrowser/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace ExampleBrowser.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/Source/Examples/WPF/ExampleBrowser/Properties/Settings.Designer.cs b/Source/Examples/WPF/ExampleBrowser/Properties/Settings.Designer.cs index a5fb2b16d..cdae272cb 100644 --- a/Source/Examples/WPF/ExampleBrowser/Properties/Settings.Designer.cs +++ b/Source/Examples/WPF/ExampleBrowser/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace ExampleBrowser.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/Source/Examples/WPF/WpfExamples/Examples/LegendsDemo/MainViewModel.cs b/Source/Examples/WPF/WpfExamples/Examples/LegendsDemo/MainViewModel.cs index 694a17836..fc3cdb8d6 100644 --- a/Source/Examples/WPF/WpfExamples/Examples/LegendsDemo/MainViewModel.cs +++ b/Source/Examples/WPF/WpfExamples/Examples/LegendsDemo/MainViewModel.cs @@ -12,7 +12,6 @@ namespace LegendsDemo using OxyPlot; using OxyPlot.Series; - using PropertyTools.DataAnnotations; using WpfExamples; using HorizontalAlignment = OxyPlot.HorizontalAlignment; @@ -101,7 +100,7 @@ public LegendSymbolPlacement LegendSymbolPlacement } } - [DisplayName("Curves"), Slidable(1, 32)] + [DisplayName("Curves"), PropertyTools.DataAnnotations.Slidable(1, 32)] public int NumberOfSeries { get { return numberOfSeries; } @@ -156,4 +155,4 @@ private PlotModel CreateModel(int n) return newModel; } } -} \ No newline at end of file +} diff --git a/Source/Examples/WPF/WpfExamples/Examples/LegendsDemo/MainWindow.xaml b/Source/Examples/WPF/WpfExamples/Examples/LegendsDemo/MainWindow.xaml index 7087b2198..17b137023 100644 --- a/Source/Examples/WPF/WpfExamples/Examples/LegendsDemo/MainWindow.xaml +++ b/Source/Examples/WPF/WpfExamples/Examples/LegendsDemo/MainWindow.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf" xmlns:pt="clr-namespace:PropertyTools.Wpf;assembly=PropertyTools.Wpf" Title="LegendsDemo" Height="720" Width="1280"> - + diff --git a/Source/Examples/WPF/WpfExamples/Properties/Resources.Designer.cs b/Source/Examples/WPF/WpfExamples/Properties/Resources.Designer.cs index c421768f7..42fa1b566 100644 --- a/Source/Examples/WPF/WpfExamples/Properties/Resources.Designer.cs +++ b/Source/Examples/WPF/WpfExamples/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace WpfExamples.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/Source/Examples/WPF/WpfExamples/Properties/Settings.Designer.cs b/Source/Examples/WPF/WpfExamples/Properties/Settings.Designer.cs index 54503e9b4..2d19a5701 100644 --- a/Source/Examples/WPF/WpfExamples/Properties/Settings.Designer.cs +++ b/Source/Examples/WPF/WpfExamples/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace WpfExamples.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/Source/Examples/WPF/WpfExamples/WpfExamples.core.csproj b/Source/Examples/WPF/WpfExamples/WpfExamples.core.csproj new file mode 100644 index 000000000..84414f176 --- /dev/null +++ b/Source/Examples/WPF/WpfExamples/WpfExamples.core.csproj @@ -0,0 +1,85 @@ + + + net8.0-windows + x86 + WinExe + WpfExamples + WpfExamples + ..\..\..\ + false + true + true + true + MinimumRecommendedRules.ruleset + + + ..\..\..\..\Icons\OxyPlot.ico + + + + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OxyPlot_64.png + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/OxyPlot.OpenXml/OxyPlot.OpenXml.core.csproj b/Source/OxyPlot.OpenXml/OxyPlot.OpenXml.core.csproj new file mode 100644 index 000000000..0b49a721e --- /dev/null +++ b/Source/OxyPlot.OpenXml/OxyPlot.OpenXml.core.csproj @@ -0,0 +1,43 @@ + + + net8.0-windows + Library + OxyPlot.OpenXml + OxyPlot.OpenXml + ..\ + false + true + true + + + $(NoWarn);1573;1591;1712;CA1416 + OxyPlot.OpenXml + OxyPlot OpenXml export library + + + ..\..\Output\NET45\ + ..\..\Output\NET45\OxyPlot.OpenXml.XML + + + + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/OxyPlot.OpenXml/Properties/AssemblyInfo.cs b/Source/OxyPlot.OpenXml/Properties/AssemblyInfo.cs index 8b25f2995..c220ef324 100644 --- a/Source/OxyPlot.OpenXml/Properties/AssemblyInfo.cs +++ b/Source/OxyPlot.OpenXml/Properties/AssemblyInfo.cs @@ -5,6 +5,3 @@ // -------------------------------------------------------------------------------------------------------------------- using System.Reflection; - -[assembly: AssemblyTitle("OxyPlot.OpenXml")] -[assembly: AssemblyDescription("OxyPlot OpenXml export library")] \ No newline at end of file diff --git a/Source/OxyPlot.OpenXml/Reporting/WordDocumentReportWriter.cs b/Source/OxyPlot.OpenXml/Reporting/WordDocumentReportWriter.cs index 86f488c74..55c333c9d 100644 --- a/Source/OxyPlot.OpenXml/Reporting/WordDocumentReportWriter.cs +++ b/Source/OxyPlot.OpenXml/Reporting/WordDocumentReportWriter.cs @@ -832,7 +832,7 @@ private void Dispose(bool disposing) this.Save(); } - this.package.Close(); + this.package.Dispose(); } } @@ -858,4 +858,4 @@ private void SetPackageProperties(OpenXmlPackage p) p.PackageProperties.LastModifiedBy = this.Creator; } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Pdf/OxyPlot.Pdf.core.csproj b/Source/OxyPlot.Pdf/OxyPlot.Pdf.core.csproj new file mode 100644 index 000000000..a328ccbc9 --- /dev/null +++ b/Source/OxyPlot.Pdf/OxyPlot.Pdf.core.csproj @@ -0,0 +1,39 @@ + + + net8.0-windows + 6.1 + Library + OxyPlot.Pdf + OxyPlot.Pdf + ..\ + false + + + $(NoWarn);1573;1591;1712;CA1416 + + + ..\..\Output\NET45\ + ..\..\Output\NET45\OxyPlot.Pdf.XML + + + true + + + OxyPlot.Pdf.snk + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/OxyPlot.Pdf/PdfRenderContext.cs b/Source/OxyPlot.Pdf/PdfRenderContext.cs index 043729501..4081b8e35 100644 --- a/Source/OxyPlot.Pdf/PdfRenderContext.cs +++ b/Source/OxyPlot.Pdf/PdfRenderContext.cs @@ -251,10 +251,10 @@ public override void DrawText( return; } - var fs = XFontStyle.Regular; + var fs = XFontStyleEx.Regular; if (fontWeight > FontWeights.Normal) { - fs = XFontStyle.Bold; + fs = XFontStyleEx.Bold; } var font = new XFont(fontFamily, (float)fontSize * FontsizeFactor, fs); @@ -332,10 +332,10 @@ public override OxySize MeasureText(string text, string fontFamily, double fontS return OxySize.Empty; } - var fs = XFontStyle.Regular; + var fs = XFontStyleEx.Regular; if (fontWeight > FontWeights.Normal) { - fs = XFontStyle.Bold; + fs = XFontStyleEx.Bold; } var font = new XFont(fontFamily, (float)fontSize * FontsizeFactor, fs); @@ -529,4 +529,4 @@ private void Dispose(bool disposing) this.disposed = true; } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Pdf/Properties/AssemblyInfo.cs b/Source/OxyPlot.Pdf/Properties/AssemblyInfo.cs index 7dc49cf95..c220ef324 100644 --- a/Source/OxyPlot.Pdf/Properties/AssemblyInfo.cs +++ b/Source/OxyPlot.Pdf/Properties/AssemblyInfo.cs @@ -5,6 +5,3 @@ // -------------------------------------------------------------------------------------------------------------------- using System.Reflection; - -[assembly: AssemblyTitle("OxyPlot.Pdf")] -[assembly: AssemblyDescription("OxyPlot PDF export library")] \ No newline at end of file diff --git a/Source/OxyPlot.Tests/Axes/AxisTests.cs b/Source/OxyPlot.Tests/Axes/AxisTests.cs index 0c74ec7d9..8159efdfc 100644 --- a/Source/OxyPlot.Tests/Axes/AxisTests.cs +++ b/Source/OxyPlot.Tests/Axes/AxisTests.cs @@ -233,7 +233,6 @@ public void A18_AxisWithHiddenLabelsGridlines() OxyAssert.AreEqual(plot, "A18"); } - [Test] public void B01_LogarithmicAxis() { @@ -434,7 +433,7 @@ public void D01_InvalidAbsoluteMaxMin() var plot = new PlotModel { Title = "Simple plot" }; plot.Axes.Add(new LinearAxis { AbsoluteMaximum = 0, AbsoluteMinimum = 0 }); ((IPlotModel)plot).Update(true); - Assert.IsNotNull(plot.GetLastUpdateException() as InvalidOperationException); + Assert.That(plot.GetLastUpdateException() as InvalidOperationException, Is.Not.Null); } [Test] @@ -443,8 +442,8 @@ public void D02_InvalidMaxMin() var plot = new PlotModel { Title = "Simple plot" }; plot.Axes.Add(new LinearAxis { Maximum = 0, Minimum = 0 }); ((IPlotModel)plot).Update(true); - Assert.AreEqual(100, plot.Axes[0].ActualMaximum); - Assert.AreEqual(0, plot.Axes[0].ActualMinimum); + Assert.That(100, Is.EqualTo(plot.Axes[0].ActualMaximum)); + Assert.That(0, Is.EqualTo(plot.Axes[0].ActualMinimum)); } [Test] @@ -453,8 +452,8 @@ public void D03_InvalidMaxMin() var plot = new PlotModel { Title = "Simple plot" }; plot.Axes.Add(new LogarithmicAxis { Maximum = 1, Minimum = 1 }); ((IPlotModel)plot).Update(true); - Assert.AreEqual(100, plot.Axes[0].ActualMaximum); - Assert.AreEqual(1, plot.Axes[0].ActualMinimum); + Assert.That(100, Is.EqualTo(plot.Axes[0].ActualMaximum)); + Assert.That(1, Is.EqualTo(plot.Axes[0].ActualMinimum)); } [Test] @@ -463,8 +462,8 @@ public void D04_InvalidLogAxis() var plot = new PlotModel { Title = "Simple plot" }; plot.Axes.Add(new LogarithmicAxis { Maximum = 1, Minimum = 0 }); ((IPlotModel)plot).Update(true); - Assert.AreEqual(100, plot.Axes[0].ActualMaximum); - Assert.AreEqual(1, plot.Axes[0].ActualMinimum); + Assert.That(100, Is.EqualTo(plot.Axes[0].ActualMaximum)); + Assert.That(1, Is.EqualTo(plot.Axes[0].ActualMinimum)); } } } diff --git a/Source/OxyPlot.Tests/Axes/AxisUtilitiesTests.cs b/Source/OxyPlot.Tests/Axes/AxisUtilitiesTests.cs index 55f5ad77c..34d105a6b 100644 --- a/Source/OxyPlot.Tests/Axes/AxisUtilitiesTests.cs +++ b/Source/OxyPlot.Tests/Axes/AxisUtilitiesTests.cs @@ -12,7 +12,7 @@ namespace OxyPlot.Tests using System; using NUnit.Framework; - + using NUnit.Framework.Legacy; using OxyPlot.Axes; /// diff --git a/Source/OxyPlot.Tests/Axes/DateTimeAxisTests.cs b/Source/OxyPlot.Tests/Axes/DateTimeAxisTests.cs index 19d49f9ee..50e014c41 100644 --- a/Source/OxyPlot.Tests/Axes/DateTimeAxisTests.cs +++ b/Source/OxyPlot.Tests/Axes/DateTimeAxisTests.cs @@ -11,7 +11,7 @@ namespace OxyPlot.Tests using System.Diagnostics.CodeAnalysis; using NSubstitute; using NUnit.Framework; - + using NUnit.Framework.Legacy; using OxyPlot.Axes; using OxyPlot.Series; @@ -23,43 +23,43 @@ public class DateTimeAxisTests [Test] public void ToDouble_ValidDate() { - Assert.AreEqual(40616, DateTimeAxis.ToDouble(new DateTime(2011, 3, 15))); + ClassicAssert.AreEqual(40616, DateTimeAxis.ToDouble(new DateTime(2011, 3, 15))); } [Test] public void ToDouble_NoDate() { - Assert.AreEqual(-693594, DateTimeAxis.ToDouble(new DateTime())); + ClassicAssert.AreEqual(-693594, DateTimeAxis.ToDouble(new DateTime())); } [Test] public void ToDateTime_ValidDate() { - Assert.AreEqual(new DateTime(2011, 3, 15), DateTimeAxis.ToDateTime(40616)); + ClassicAssert.AreEqual(new DateTime(2011, 3, 15), DateTimeAxis.ToDateTime(40616)); } [Test] public void ToDateTime_NoDate() { - Assert.AreEqual(new DateTime(), DateTimeAxis.ToDateTime(-693594)); + ClassicAssert.AreEqual(new DateTime(), DateTimeAxis.ToDateTime(-693594)); } [Test] public void ToDateTime_NaN() { - Assert.AreEqual(new DateTime(), DateTimeAxis.ToDateTime(double.NaN)); + ClassicAssert.AreEqual(new DateTime(), DateTimeAxis.ToDateTime(double.NaN)); } [Test] public void ToDateTime_VeryBigValue() { - Assert.AreEqual(new DateTime(), DateTimeAxis.ToDateTime(double.MaxValue)); + ClassicAssert.AreEqual(new DateTime(), DateTimeAxis.ToDateTime(double.MaxValue)); } [Test] public void ToDateTime_VerySmallValue() { - Assert.AreEqual(new DateTime(), DateTimeAxis.ToDateTime(double.MinValue)); + ClassicAssert.AreEqual(new DateTime(), DateTimeAxis.ToDateTime(double.MinValue)); } [Test] @@ -76,7 +76,7 @@ public void TestGetTickValues() axis.MinorStep = double.NaN; plot.Axes.Add(axis); - var yaxis1 = new LinearAxis { Position = AxisPosition.Left, Title = "Y1", Key = "Y1", StartPosition = 0, EndPosition = 0.5 }; + var yaxis1 = new LinearAxis { Position = AxisPosition.Left, Title = "Y1", Key = "Y1", StartPosition = 0, EndPosition = 0.5 }; plot.Axes.Add(yaxis1); axis.Reset(); ((IPlotModel)plot).Render(rc, 500, 500); @@ -87,7 +87,7 @@ public void TestGetTickValues() IList majorTickValues; IList minorTickValues; axis.GetTickValues(out majorLabelValues, out majorTickValues, out minorTickValues); - Assert.AreEqual(5, majorLabelValues.Count); + ClassicAssert.AreEqual(5, majorLabelValues.Count); Action addExamplePoints = ls => { @@ -116,7 +116,7 @@ public void TestGetTickValues() axis.Render(rc, plot, AxisLayer.BelowSeries, 2); axis.GetTickValues(out majorLabelValues, out majorTickValues, out minorTickValues); - Assert.AreEqual(8, majorLabelValues.Count); + ClassicAssert.AreEqual(8, majorLabelValues.Count); } [Test] @@ -145,7 +145,7 @@ public void GetSetLabelsTickValues() IList minorTickValues; axis.GetTickValues(out majorLabelValues, out majorTickValues, out minorTickValues); - Assert.AreEqual(16, majorLabelValues.Count); + ClassicAssert.AreEqual(16, majorLabelValues.Count); } } } diff --git a/Source/OxyPlot.Tests/Axes/LinearAxisTests.cs b/Source/OxyPlot.Tests/Axes/LinearAxisTests.cs index db8ac6d5b..5e20966fc 100644 --- a/Source/OxyPlot.Tests/Axes/LinearAxisTests.cs +++ b/Source/OxyPlot.Tests/Axes/LinearAxisTests.cs @@ -11,9 +11,8 @@ namespace OxyPlot.Tests { using System; using System.Globalization; - using NUnit.Framework; - + using NUnit.Framework.Legacy; using OxyPlot.Axes; /// @@ -35,7 +34,7 @@ public void TwoEqualAxes() { var axis1 = new LinearAxis(); var axis2 = new LinearAxis(); - Assert.IsTrue(axis1.GetHashCode() != axis2.GetHashCode()); + ClassicAssert.IsTrue(axis1.GetHashCode() != axis2.GetHashCode()); } } @@ -56,7 +55,7 @@ public void FormatAsFractionsZero() FractionUnit = Math.PI, FractionUnitSymbol = "π" }; - Assert.AreEqual("0", axis.FormatValue(0)); + ClassicAssert.AreEqual("0", axis.FormatValue(0)); } /// @@ -71,7 +70,7 @@ public void FormatAsFractionsPiHalf() FractionUnit = Math.PI, FractionUnitSymbol = "π" }; - Assert.AreEqual("π/2", axis.FormatValue(0.5 * Math.PI)); + ClassicAssert.AreEqual("π/2", axis.FormatValue(0.5 * Math.PI)); } /// @@ -86,7 +85,7 @@ public void FormatAsFractionsTwoPi() FractionUnit = Math.PI, FractionUnitSymbol = "π" }; - Assert.AreEqual("2π", axis.FormatValue(2 * Math.PI)); + ClassicAssert.AreEqual("2π", axis.FormatValue(2 * Math.PI)); } /// @@ -101,7 +100,7 @@ public void FormatAsFractionsThreeHalfPi() FractionUnit = Math.PI, FractionUnitSymbol = "π" }; - Assert.AreEqual("3π/2", axis.FormatValue(3d / 2 * Math.PI)); + ClassicAssert.AreEqual("3π/2", axis.FormatValue(3d / 2 * Math.PI)); } /// @@ -120,8 +119,8 @@ public void FormatAsFractionsWithStringFormat() }; model.Axes.Add(axis); ((IPlotModel)model).Update(true); - Assert.AreEqual("1.273π", axis.FormatValue(4)); + ClassicAssert.AreEqual("1.273π", axis.FormatValue(4)); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Foundation/CohenSutherlandClippingTests.cs b/Source/OxyPlot.Tests/Foundation/CohenSutherlandClippingTests.cs index 890672891..ab3172371 100644 --- a/Source/OxyPlot.Tests/Foundation/CohenSutherlandClippingTests.cs +++ b/Source/OxyPlot.Tests/Foundation/CohenSutherlandClippingTests.cs @@ -10,6 +10,7 @@ namespace OxyPlot.Tests { using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Provides unit tests for the class. @@ -29,7 +30,7 @@ public class IsInside public void InsidePoint() { var clipping = new CohenSutherlandClipping(new OxyRect(0, 0, 1, 1)); - Assert.IsTrue(clipping.IsInside(new ScreenPoint(0.5, 0.5))); + ClassicAssert.IsTrue(clipping.IsInside(new ScreenPoint(0.5, 0.5))); } /// @@ -39,7 +40,7 @@ public void InsidePoint() public void OutsidePoint() { var clipping = new CohenSutherlandClipping(new OxyRect(0, 0, 1, 1)); - Assert.IsFalse(clipping.IsInside(new ScreenPoint(-0.5, 0.5))); + ClassicAssert.IsFalse(clipping.IsInside(new ScreenPoint(-0.5, 0.5))); } } @@ -58,9 +59,9 @@ public void EndpointsOutsideArea() var clipping = new CohenSutherlandClipping(new OxyRect(0, 0, 1, 1)); var p0 = new ScreenPoint(0.3, -0.2); var p1 = new ScreenPoint(0.6, 1.3); - Assert.IsTrue(clipping.ClipLine(ref p0, ref p1)); - Assert.AreEqual(0, p0.Y); - Assert.AreEqual(1, p1.Y); + ClassicAssert.IsTrue(clipping.ClipLine(ref p0, ref p1)); + ClassicAssert.AreEqual(0, p0.Y); + ClassicAssert.AreEqual(1, p1.Y); } /// @@ -73,9 +74,9 @@ public void EndpointsOutsideArea2() var clipping = new CohenSutherlandClipping(new OxyRect(0.3, -0.5, 0.5, 1)); var p0 = new ScreenPoint(0, 0); var p1 = new ScreenPoint(1, 0); - Assert.IsTrue(clipping.ClipLine(ref p0, ref p1)); - Assert.AreEqual(new ScreenPoint(0.3, 0), p0); - Assert.AreEqual(new ScreenPoint(0.8, 0), p1); + ClassicAssert.IsTrue(clipping.ClipLine(ref p0, ref p1)); + ClassicAssert.AreEqual(new ScreenPoint(0.3, 0), p0); + ClassicAssert.AreEqual(new ScreenPoint(0.8, 0), p1); } /// @@ -87,9 +88,9 @@ public void EndpointsInsideArea() var clipping = new CohenSutherlandClipping(new OxyRect(0, 0, 1, 1)); var p0 = new ScreenPoint(0.3, 0.2); var p1 = new ScreenPoint(0.6, 0.8); - Assert.IsTrue(clipping.ClipLine(ref p0, ref p1)); - Assert.AreEqual(0.2, p0.Y); - Assert.AreEqual(0.8, p1.Y); + ClassicAssert.IsTrue(clipping.ClipLine(ref p0, ref p1)); + ClassicAssert.AreEqual(0.2, p0.Y); + ClassicAssert.AreEqual(0.8, p1.Y); } /// @@ -101,10 +102,10 @@ public void LineOutsideArea() var clipping = new CohenSutherlandClipping(new OxyRect(0, 0, 1, 1)); var p0 = new ScreenPoint(0.3, -0.2); var p1 = new ScreenPoint(0.6, -0.2); - Assert.IsFalse(clipping.ClipLine(ref p0, ref p1)); - Assert.AreEqual(-0.2, p0.Y); - Assert.AreEqual(-0.2, p1.Y); + ClassicAssert.IsFalse(clipping.ClipLine(ref p0, ref p1)); + ClassicAssert.AreEqual(-0.2, p0.Y); + ClassicAssert.AreEqual(-0.2, p1.Y); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Foundation/DataPointTests.cs b/Source/OxyPlot.Tests/Foundation/DataPointTests.cs index a18ed7584..8528eab86 100644 --- a/Source/OxyPlot.Tests/Foundation/DataPointTests.cs +++ b/Source/OxyPlot.Tests/Foundation/DataPointTests.cs @@ -10,6 +10,7 @@ namespace OxyPlot.Tests { using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Provides unit tests for the type. @@ -28,9 +29,9 @@ public class IsDefined [Test] public void ValidPoints() { - Assert.IsTrue(new DataPoint(1, 2).IsDefined()); - Assert.IsTrue(new DataPoint(double.MaxValue, double.MaxValue).IsDefined()); - Assert.IsTrue(new DataPoint(double.MinValue, double.MinValue).IsDefined()); + ClassicAssert.IsTrue(new DataPoint(1, 2).IsDefined()); + ClassicAssert.IsTrue(new DataPoint(double.MaxValue, double.MaxValue).IsDefined()); + ClassicAssert.IsTrue(new DataPoint(double.MinValue, double.MinValue).IsDefined()); } /// @@ -39,12 +40,12 @@ public void ValidPoints() [Test] public void InvalidPoints() { - Assert.IsFalse(new DataPoint(double.NaN, double.NaN).IsDefined()); - Assert.IsFalse(new DataPoint(double.NaN, 2).IsDefined()); - Assert.IsFalse(new DataPoint(2, double.NaN).IsDefined()); + ClassicAssert.IsFalse(new DataPoint(double.NaN, double.NaN).IsDefined()); + ClassicAssert.IsFalse(new DataPoint(double.NaN, 2).IsDefined()); + ClassicAssert.IsFalse(new DataPoint(2, double.NaN).IsDefined()); var p = DataPoint.Undefined; - Assert.IsFalse(p.IsDefined()); + ClassicAssert.IsFalse(p.IsDefined()); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Foundation/OxyColorTests.cs b/Source/OxyPlot.Tests/Foundation/OxyColorTests.cs index 6abd7f911..2c43f9666 100644 --- a/Source/OxyPlot.Tests/Foundation/OxyColorTests.cs +++ b/Source/OxyPlot.Tests/Foundation/OxyColorTests.cs @@ -7,8 +7,8 @@ namespace OxyPlot.Tests { using System.Diagnostics.CodeAnalysis; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -18,113 +18,113 @@ public class OxyColorTests [Test] public void Parse() { - Assert.AreEqual(OxyColors.Red, OxyColor.Parse("#FF0000")); - Assert.AreEqual(OxyColors.Red, OxyColor.Parse("#FFFF0000")); - Assert.AreEqual(OxyColors.Red, OxyColor.Parse("255,0,0")); - Assert.AreEqual(OxyColors.Red, OxyColor.Parse("255,255,0,0")); + ClassicAssert.AreEqual(OxyColors.Red, OxyColor.Parse("#FF0000")); + ClassicAssert.AreEqual(OxyColors.Red, OxyColor.Parse("#FFFF0000")); + ClassicAssert.AreEqual(OxyColors.Red, OxyColor.Parse("255,0,0")); + ClassicAssert.AreEqual(OxyColors.Red, OxyColor.Parse("255,255,0,0")); } [Test] public void ColorDifference() { - Assert.AreEqual(1.1189122525867927d, OxyColor.ColorDifference(OxyColors.Red, OxyColors.Green), 1e-6); + ClassicAssert.AreEqual(1.1189122525867927d, OxyColor.ColorDifference(OxyColors.Red, OxyColors.Green), 1e-6); } [Test] public void FromAColor() { - Assert.AreEqual(OxyColor.FromArgb(0x80, 0xff, 0, 0), OxyColor.FromAColor(0x80, OxyColors.Red)); + ClassicAssert.AreEqual(OxyColor.FromArgb(0x80, 0xff, 0, 0), OxyColor.FromAColor(0x80, OxyColors.Red)); } [Test] public void FromHsv() { - Assert.AreEqual(OxyColors.Red, OxyColor.FromHsv(0, 1, 1)); + ClassicAssert.AreEqual(OxyColors.Red, OxyColor.FromHsv(0, 1, 1)); } [Test] public void FromRgb() { - Assert.AreEqual(OxyColors.Red, OxyColor.FromRgb(255, 0, 0)); + ClassicAssert.AreEqual(OxyColors.Red, OxyColor.FromRgb(255, 0, 0)); } [Test] public void FromArgb() { - Assert.AreEqual(OxyColors.Red, OxyColor.FromArgb(255, 255, 0, 0)); + ClassicAssert.AreEqual(OxyColors.Red, OxyColor.FromArgb(255, 255, 0, 0)); } [Test] public void FromUInt32() { - Assert.AreEqual(OxyColors.Red, OxyColor.FromUInt32(0xFFFF0000)); + ClassicAssert.AreEqual(OxyColors.Red, OxyColor.FromUInt32(0xFFFF0000)); } [Test] public void GetColorName() { - Assert.AreEqual("Red", OxyColors.Red.GetColorName()); + ClassicAssert.AreEqual("Red", OxyColors.Red.GetColorName()); } [Test] public void ChangeIntensity() { - Assert.AreEqual(OxyColor.FromArgb(255, 127, 0, 0), OxyColors.Red.ChangeIntensity(0.5)); + ClassicAssert.AreEqual(OxyColor.FromArgb(255, 127, 0, 0), OxyColors.Red.ChangeIntensity(0.5)); } [Test] public void ChangeSaturation() { - Assert.AreEqual(OxyColor.FromArgb(255, 255, 127, 127), OxyColors.Red.ChangeSaturation(0.5)); + ClassicAssert.AreEqual(OxyColor.FromArgb(255, 255, 127, 127), OxyColors.Red.ChangeSaturation(0.5)); } [Test] public void ChangeSaturation_OverSaturate() { - Assert.AreEqual(OxyColor.FromArgb(255, 255, 0, 0), OxyColors.Red.ChangeSaturation(2)); + ClassicAssert.AreEqual(OxyColor.FromArgb(255, 255, 0, 0), OxyColors.Red.ChangeSaturation(2)); } [Test] public void Complementary() { - Assert.AreEqual(OxyColors.Cyan, OxyColors.Red.Complementary()); + ClassicAssert.AreEqual(OxyColors.Cyan, OxyColors.Red.Complementary()); } [Test] public void ToByteString() { - Assert.AreEqual("255,255,0,0", OxyColors.Red.ToByteString()); + ClassicAssert.AreEqual("255,255,0,0", OxyColors.Red.ToByteString()); } [Test] public void ToCode() { - Assert.AreEqual("OxyColors.Red", OxyColors.Red.ToCode()); - Assert.AreEqual("OxyColor.FromArgb(1, 2, 3, 4)", OxyColor.FromArgb(0x01, 0x02, 0x03, 0x04).ToCode()); + ClassicAssert.AreEqual("OxyColors.Red", OxyColors.Red.ToCode()); + ClassicAssert.AreEqual("OxyColor.FromArgb(1, 2, 3, 4)", OxyColor.FromArgb(0x01, 0x02, 0x03, 0x04).ToCode()); } [Test] public void ToHsv() { - Assert.AreEqual(new[] { 0, 1, 1 }, OxyColors.Red.ToHsv()); + ClassicAssert.AreEqual(new[] { 0, 1, 1 }, OxyColors.Red.ToHsv()); } [Test] public new void ToString() { - Assert.AreEqual("#ffff0000", OxyColors.Red.ToString()); + ClassicAssert.AreEqual("#ffff0000", OxyColors.Red.ToString()); } [Test] public void ToUint() { - Assert.AreEqual(0xFFFF0000, OxyColors.Red.ToUint()); + ClassicAssert.AreEqual(0xFFFF0000, OxyColors.Red.ToUint()); } [Test] public void HueDifference() { - Assert.AreEqual(1.0 / 3, OxyColor.HueDifference(OxyColors.Red, OxyColors.Blue), 1e-6); + ClassicAssert.AreEqual(1.0 / 3, OxyColor.HueDifference(OxyColors.Red, OxyColors.Blue), 1e-6); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Foundation/OxyPaletteTests.cs b/Source/OxyPlot.Tests/Foundation/OxyPaletteTests.cs index f402403c1..9d99f65ee 100644 --- a/Source/OxyPlot.Tests/Foundation/OxyPaletteTests.cs +++ b/Source/OxyPlot.Tests/Foundation/OxyPaletteTests.cs @@ -7,8 +7,8 @@ namespace OxyPlot.Tests { using System.Diagnostics.CodeAnalysis; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -19,19 +19,19 @@ public class OxyPaletteTests public void Interpolate() { var palette = OxyPalette.Interpolate(5, OxyColors.Blue, OxyColors.White, OxyColors.Red); - Assert.AreEqual(5, palette.Colors.Count); - Assert.AreEqual(OxyColors.Blue, palette.Colors[0]); - Assert.AreEqual(OxyColor.FromRgb(127, 127, 255), palette.Colors[1]); - Assert.AreEqual(OxyColors.White, palette.Colors[2]); - Assert.AreEqual(OxyColor.FromRgb(255, 127, 127), palette.Colors[3]); - Assert.AreEqual(OxyColors.Red, palette.Colors[4]); + ClassicAssert.AreEqual(5, palette.Colors.Count); + ClassicAssert.AreEqual(OxyColors.Blue, palette.Colors[0]); + ClassicAssert.AreEqual(OxyColor.FromRgb(127, 127, 255), palette.Colors[1]); + ClassicAssert.AreEqual(OxyColors.White, palette.Colors[2]); + ClassicAssert.AreEqual(OxyColor.FromRgb(255, 127, 127), palette.Colors[3]); + ClassicAssert.AreEqual(OxyColors.Red, palette.Colors[4]); } [Test] public void Constructor() { var palette = new OxyPalette(OxyColors.Blue, OxyColors.White, OxyColors.Red); - Assert.AreEqual(3, palette.Colors.Count); + ClassicAssert.AreEqual(3, palette.Colors.Count); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Foundation/RenderingExtensionsTests.cs b/Source/OxyPlot.Tests/Foundation/RenderingExtensionsTests.cs index 35e2628ba..c99872ac2 100644 --- a/Source/OxyPlot.Tests/Foundation/RenderingExtensionsTests.cs +++ b/Source/OxyPlot.Tests/Foundation/RenderingExtensionsTests.cs @@ -12,10 +12,9 @@ namespace OxyPlot.Tests using System; using System.Collections.Generic; using System.Diagnostics; - using NSubstitute; - using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Provides unit tests for the class. @@ -38,7 +37,7 @@ public void EmptyArray() var rc = Substitute.For(); var received = new List(); rc.DrawClippedLine(clippingRectangle, points, 1, OxyColors.Black, 1, null, LineJoin.Miter, false, null, received.AddRange); - Assert.AreEqual(0, received.Count); + ClassicAssert.AreEqual(0, received.Count); } /// @@ -52,7 +51,7 @@ public void SinglePointInside() var rc = Substitute.For(); var received = new List(); rc.DrawClippedLine(clippingRectangle, points, 1, OxyColors.Black, 1, null, LineJoin.Miter, false, null, received.AddRange); - Assert.AreEqual(2, received.Count); + ClassicAssert.AreEqual(2, received.Count); } /// @@ -66,7 +65,7 @@ public void SinglePointOutside() var rc = Substitute.For(); var received = new List(); rc.DrawClippedLine(clippingRectangle, points, 1, OxyColors.Black, 1, null, LineJoin.Miter, false, null, received.AddRange); - Assert.AreEqual(0, received.Count); + ClassicAssert.AreEqual(0, received.Count); } /// @@ -80,10 +79,10 @@ public void CrossingLine() var rc = Substitute.For(); var received = new List(); rc.DrawClippedLine(clippingRectangle, points, 1, OxyColors.Black, 1, null, LineJoin.Miter, false, null, received.AddRange); - Assert.AreEqual(2, received.Count); - Assert.AreEqual(new ScreenPoint(30, 0), received[0]); - Assert.AreEqual(new ScreenPoint(80, 0), received[1]); + ClassicAssert.AreEqual(2, received.Count); + ClassicAssert.AreEqual(new ScreenPoint(30, 0), received[0]); + ClassicAssert.AreEqual(new ScreenPoint(80, 0), received[1]); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Foundation/ScreenPointHelperTests.cs b/Source/OxyPlot.Tests/Foundation/ScreenPointHelperTests.cs index 27645bf32..03198c289 100644 --- a/Source/OxyPlot.Tests/Foundation/ScreenPointHelperTests.cs +++ b/Source/OxyPlot.Tests/Foundation/ScreenPointHelperTests.cs @@ -8,8 +8,8 @@ namespace OxyPlot.Tests { using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -19,7 +19,7 @@ public class ScreenPointHelperTests [Test] public void IsPointInPolygon_NullPoints() { - Assert.IsFalse(ScreenPointHelper.IsPointInPolygon(default(ScreenPoint), null)); + ClassicAssert.IsFalse(ScreenPointHelper.IsPointInPolygon(default(ScreenPoint), null)); } [Test] @@ -27,7 +27,7 @@ public void ResamplePoints() { var points = CreatePointList(); var result = ScreenPointHelper.ResamplePoints(points, 1); - Assert.AreEqual(4, result.Count); + ClassicAssert.AreEqual(4, result.Count); } [Test] @@ -35,8 +35,8 @@ public void GetCentroid() { var points = CreatePointList(); var centroid = ScreenPointHelper.GetCentroid(points); - Assert.AreEqual(0.041666, centroid.X, 1e-6); - Assert.AreEqual(0.708333, centroid.Y, 1e-6); + ClassicAssert.AreEqual(0.041666, centroid.X, 1e-6); + ClassicAssert.AreEqual(0.708333, centroid.Y, 1e-6); } private static IList CreatePointList() @@ -49,4 +49,4 @@ private static IList CreatePointList() return points; } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Foundation/SutherlandHodgmanClippingTests.cs b/Source/OxyPlot.Tests/Foundation/SutherlandHodgmanClippingTests.cs index e2729f09a..3d4dc1e7a 100644 --- a/Source/OxyPlot.Tests/Foundation/SutherlandHodgmanClippingTests.cs +++ b/Source/OxyPlot.Tests/Foundation/SutherlandHodgmanClippingTests.cs @@ -8,8 +8,8 @@ namespace OxyPlot.Tests { using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -22,7 +22,7 @@ public void ClipPolygon() var bounds = new OxyRect(0, 0, 1, 1); var points = CreatePointList(); var result = SutherlandHodgmanClipping.ClipPolygon(bounds, points); - Assert.AreEqual(4, result.Count); + ClassicAssert.AreEqual(4, result.Count); } private static IList CreatePointList() @@ -30,4 +30,4 @@ private static IList CreatePointList() return new List { new ScreenPoint(-1, -1), new ScreenPoint(1, -2), new ScreenPoint(2, 2), new ScreenPoint(-2, 3) }; } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Imaging/Deflate/DeflateTests.cs b/Source/OxyPlot.Tests/Imaging/Deflate/DeflateTests.cs index ef8a875d8..8c89c568b 100644 --- a/Source/OxyPlot.Tests/Imaging/Deflate/DeflateTests.cs +++ b/Source/OxyPlot.Tests/Imaging/Deflate/DeflateTests.cs @@ -9,8 +9,8 @@ namespace OxyPlot.Tests using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -52,11 +52,11 @@ public void Deflate_InflateAndDeflate_ShouldEqualOriginal() private static void AssertArrayEquals(T[] refOut, T[] actualOut) { - Assert.AreEqual(refOut.Length, actualOut.Length, "Different length"); + ClassicAssert.AreEqual(refOut.Length, actualOut.Length, "Different length"); for (int i = 0; i < refOut.Length; i++) { - Assert.AreEqual(refOut[i], actualOut[i], "Different at byte " + i); + ClassicAssert.AreEqual(refOut[i], actualOut[i], "Different at byte " + i); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Imaging/Deflate/NayukiDeflateTests.cs b/Source/OxyPlot.Tests/Imaging/Deflate/NayukiDeflateTests.cs index a2a5a25cc..f86da1a16 100644 --- a/Source/OxyPlot.Tests/Imaging/Deflate/NayukiDeflateTests.cs +++ b/Source/OxyPlot.Tests/Imaging/Deflate/NayukiDeflateTests.cs @@ -27,18 +27,18 @@ public class NayukiDeflateTests { /* Test cases */ - [Test, ExpectedException] + [Test] public void testReservedBlockType() { // Reserved block type - test("1 11 00000", string.Empty); + Assert.That(() => test("1 11 00000", string.Empty), Throws.Exception); } - [Test, ExpectedException] + [Test] public void testEofInBlockType() { // Partial block type - test("1 0", string.Empty); + Assert.That(() => test("1 0", string.Empty), Throws.Exception); } [Test] @@ -55,7 +55,8 @@ public void testUncompressedThreeBytes() test("1 00 00000 1100000000000000 0011111111111111 10100000 00101000 11000100", "05 14 23"); } - [Test, Ignore] + [Test] + [Ignore("because")] public void testUncompressedTwoBlocks() { // Uncompressed block len=1: 05 @@ -63,33 +64,35 @@ public void testUncompressedTwoBlocks() test("0 00 00000 0100000000000000 1011111111111111 10100000 00101000 1 00 00000 1000000000000000 0111111111111111 11000100", "05 14 23"); } - [Test, ExpectedException, Ignore] + [Test] + [Ignore("because")] public void testUncompressedEofBeforeLength() { // Uncompressed block (partial padding) (no length) - test("1 00 000", string.Empty); + Assert.That(() => test("1 00 000", string.Empty), Throws.Exception); } - [Test, ExpectedException] + [Test] public void testUncompressedEofInLength() { // Uncompressed block (partial length) - test("1 00 00000 0000000000", string.Empty); + Assert.That(() => test("1 00 00000 0000000000", string.Empty), Throws.Exception); } - [Test, ExpectedException] + [Test] public void testUncompressedMismatchedLength() { // Uncompressed block (mismatched len and nlen) - test("1 00 00000 0010000000010000 1111100100110101", string.Empty); + Assert.That(() => test("1 00 00000 0010000000010000 1111100100110101", string.Empty), Throws.Exception); } - [Test, ExpectedException, Ignore] + [Test] + [Ignore("because")] public void testUncompressedBlockNoFinalBlock() { // Uncompressed block len=0: (empty) // No final block - test("0 00 00000 0000000000000000 1111111111111111", string.Empty); + Assert.That(() => test("0 00 00000 0000000000000000 1111111111111111", string.Empty), Throws.Exception); } [Test] @@ -127,32 +130,32 @@ public void testFixedHuffmanOverlappingRun1() test("1 10 10111110 10111111 0000011 00001 0000000", "8E 8F 8E 8F 8E 8F 8E"); } - [Test, ExpectedException] + [Test] public void testFixedHuffmanInvalidLengthCode286() { // Fixed Huffman block: #286 - test("1 10 11000110", string.Empty); + Assert.That(() => test("1 10 11000110", string.Empty), Throws.Exception); } - [Test, ExpectedException] + [Test] public void testFixedHuffmanInvalidLengthCode287() { // Fixed Huffman block: #287 - test("1 10 11000111", string.Empty); + Assert.That(() => test("1 10 11000111", string.Empty), Throws.Exception); } - [Test, ExpectedException] + [Test] public void testFixedHuffmanInvalidDistanceCode30() { // Fixed Huffman block: 00 #257 #30 - test("1 10 00110000 0000001 11110", string.Empty); + Assert.That(() => test("1 10 00110000 0000001 11110", string.Empty), Throws.Exception); } - [Test, ExpectedException] + [Test] public void testFixedHuffmanInvalidDistanceCode31() { // Fixed Huffman block: 00 #257 #31 - test("1 10 00110000 0000001 11111", string.Empty); + Assert.That(() => test("1 10 00110000 0000001 11111", string.Empty), Throws.Exception); } [Test] @@ -191,7 +194,7 @@ public void testDynamicHuffmanEmptyNoDistanceCode() test(blockHeader + codeCounts + codeLenCodeLens + codeLens + data, string.Empty); } - [Test, ExpectedException] + [Test] public void testDynamicHuffmanCodeLengthRepeatAtStart() { // Dynamic Huffman block: @@ -202,10 +205,10 @@ public void testDynamicHuffmanCodeLengthRepeatAtStart() var codeCounts = "00000 00000 0111"; var codeLenCodeLens = "100 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 100"; var codeLens = "1"; - test(blockHeader + codeCounts + codeLenCodeLens + codeLens, string.Empty); + Assert.That(() => test(blockHeader + codeCounts + codeLenCodeLens + codeLens, string.Empty), Throws.Exception); } - [Test, ExpectedException] + [Test] public void testDynamicHuffmanTooManyCodeLengthItems() { // Dynamic Huffman block: @@ -216,7 +219,7 @@ public void testDynamicHuffmanTooManyCodeLengthItems() var codeCounts = "00000 00000 0111"; var codeLenCodeLens = "000 000 100 000 000 000 000 000 000 000 000 000 000 000 000 000 000 100"; var codeLens = "0 0 11111111 10011011"; - test(blockHeader + codeCounts + codeLenCodeLens + codeLens, string.Empty); + Assert.That(() => test(blockHeader + codeCounts + codeLenCodeLens + codeLens, string.Empty), Throws.Exception); } /* Utility method */ @@ -246,11 +249,11 @@ private static void test(string input, string refOutput) private static void AssertArrayEquals(T[] refOut, T[] actualOut) { - Assert.AreEqual(refOut.Length, actualOut.Length); + Assert.That(refOut.Length, Is.EqualTo(actualOut.Length)); for (int i = 0; i < refOut.Length; i++) { - Assert.AreEqual(refOut[i], actualOut[i]); + Assert.That(refOut[i], Is.EqualTo(actualOut[i])); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Imaging/Png/PngDecoderTests.cs b/Source/OxyPlot.Tests/Imaging/Png/PngDecoderTests.cs index cfdc9a8a7..28b805e57 100644 --- a/Source/OxyPlot.Tests/Imaging/Png/PngDecoderTests.cs +++ b/Source/OxyPlot.Tests/Imaging/Png/PngDecoderTests.cs @@ -9,8 +9,8 @@ namespace OxyPlot.Tests using System; using System.Diagnostics.CodeAnalysis; using System.IO; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -23,9 +23,9 @@ public void Decode_32bitTestImages(string path, int w, int h) { var d = new PngDecoder(); var pixels = d.Decode(File.ReadAllBytes(path)); - Assert.AreEqual(w, pixels.GetLength(0)); - Assert.AreEqual(h, pixels.GetLength(1)); - Assert.IsNotNull(pixels); + ClassicAssert.AreEqual(w, pixels.GetLength(0)); + ClassicAssert.AreEqual(h, pixels.GetLength(1)); + ClassicAssert.IsNotNull(pixels); var e = new PngEncoder(new PngEncoderOptions()); var encodedPixels = e.Encode(pixels); File.WriteAllBytes(Path.ChangeExtension(path, "out.png"), encodedPixels); @@ -38,7 +38,7 @@ public void Decode_8bitTestImages(string path, int w, int h) var d = new PngDecoder(); // Expect exception here, 8bit pngs are not yet supported - Assert.Throws(() => d.Decode(File.ReadAllBytes(path))); + ClassicAssert.Throws(() => d.Decode(File.ReadAllBytes(path))); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Imaging/TestImages/OxyImageTests.cs b/Source/OxyPlot.Tests/Imaging/TestImages/OxyImageTests.cs index 828b32a42..cc1cd044b 100644 --- a/Source/OxyPlot.Tests/Imaging/TestImages/OxyImageTests.cs +++ b/Source/OxyPlot.Tests/Imaging/TestImages/OxyImageTests.cs @@ -10,8 +10,8 @@ namespace OxyPlot.Tests using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -28,11 +28,11 @@ public class OxyImageTests public void GetFormat_TestFiles_(string fileName, ImageFormat expectedImageFormat) { var image = new OxyImage(File.ReadAllBytes(@"Imaging\TestImages\" + fileName)); - Assert.AreEqual(expectedImageFormat, image.Format); - Assert.AreEqual(137, image.Width); - Assert.AreEqual(59, image.Height); - Assert.AreEqual(72, Math.Round(image.DpiX)); - Assert.AreEqual(72, Math.Round(image.DpiY)); + ClassicAssert.AreEqual(expectedImageFormat, image.Format); + ClassicAssert.AreEqual(137, image.Width); + ClassicAssert.AreEqual(59, image.Height); + ClassicAssert.AreEqual(72, Math.Round(image.DpiX)); + ClassicAssert.AreEqual(72, Math.Round(image.DpiY)); } [Test] @@ -149,4 +149,4 @@ public void Discussion453825_199() File.WriteAllBytes(@"Imaging\Discussion453825_199a.bmp", bytes1); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/OxyAssert.cs b/Source/OxyPlot.Tests/OxyAssert.cs index fa7f422ff..1d452ab9c 100644 --- a/Source/OxyPlot.Tests/OxyAssert.cs +++ b/Source/OxyPlot.Tests/OxyAssert.cs @@ -10,8 +10,7 @@ namespace OxyPlot.Tests { using System.IO; - - using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Provides methods to assert that plots look as expected. @@ -50,7 +49,7 @@ public static void AreEqual(PlotModel plot, string name) var baselineSvg = File.ReadAllText(baseline); var actualSvg = File.ReadAllText(path); - Assert.IsTrue(string.Equals(baselineSvg, actualSvg), "Actual svg is not equal to baseline (" + Path.GetFullPath(baseline) + ")"); + ClassicAssert.IsTrue(string.Equals(baselineSvg, actualSvg), "Actual svg is not equal to baseline (" + Path.GetFullPath(baseline) + ")"); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/OxyPlot.Tests.core.csproj b/Source/OxyPlot.Tests/OxyPlot.Tests.core.csproj new file mode 100644 index 000000000..27d13840e --- /dev/null +++ b/Source/OxyPlot.Tests/OxyPlot.Tests.core.csproj @@ -0,0 +1,72 @@ + + + net8.0-windows + Library + ..\ + false + true + true + + + $(NoWarn),1573,1591,1712 + + + + + + + Properties\GlobalAssemblyInfo.cs + + + + + Designer + PreserveNewest + + + Designer + PreserveNewest + + + Designer + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/OxyPlot.Tests/OxyPlot.Tests.csproj b/Source/OxyPlot.Tests/OxyPlot.Tests.csproj index 283c3ab8e..0746ff377 100644 --- a/Source/OxyPlot.Tests/OxyPlot.Tests.csproj +++ b/Source/OxyPlot.Tests/OxyPlot.Tests.csproj @@ -1,106 +1,19 @@ - - + - Debug - AnyCPU - {E6218B88-69F5-4E3F-9ABC-93AB82FD77AD} + net8.0-windows Library - Properties - OxyPlot.Tests - OxyPlot.Tests - v4.6.1 - 512 - ..\ + false + true + true - $(NoWarn),1573,1591,1712 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - ..\packages\NSubstitute.1.7.1.0\lib\NET40\NSubstitute.dll - - - False - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - - - - - - - - - Properties\GlobalAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -133,28 +46,24 @@ PreserveNewest - - - Designer - - - {facb89e5-53a5-4748-9f5b-e0714ebb37b2} - ExampleLibrary - - - {7A0B35C0-DD17-4964-8E9A-44D6CECDC692} - OxyPlot - + + - - + + + + + + + + diff --git a/Source/OxyPlot.Tests/Pdf/PdfExporterTests.cs b/Source/OxyPlot.Tests/Pdf/PdfExporterTests.cs index 74d1ef476..6d6b29cd7 100644 --- a/Source/OxyPlot.Tests/Pdf/PdfExporterTests.cs +++ b/Source/OxyPlot.Tests/Pdf/PdfExporterTests.cs @@ -52,8 +52,8 @@ public void Export_AllExamplesInExampleLibrary_CheckThatAllFilesExist() } } - Assert.IsTrue(File.Exists(path)); + Assert.That(File.Exists(path), Is.True); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Pdf/PortableDocumentTests.cs b/Source/OxyPlot.Tests/Pdf/PortableDocumentTests.cs index 75c32ca27..a24b250da 100644 --- a/Source/OxyPlot.Tests/Pdf/PortableDocumentTests.cs +++ b/Source/OxyPlot.Tests/Pdf/PortableDocumentTests.cs @@ -10,8 +10,8 @@ namespace OxyPlot.Tests using System.Globalization; using System.IO; using System.Text; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -54,7 +54,8 @@ public void DrawText_HelloWorld() doc.Save(Folder + "DrawText.pdf"); } - [Test, Ignore("Not supported")] + [Test] + [Ignore("Not supported")] public void DrawText_SpecialCharacters() { var doc = new PortableDocument(); @@ -63,7 +64,7 @@ public void DrawText_SpecialCharacters() var s = "π"; doc.DrawText(50, 400, s); doc.Save(Folder + "DrawText_SpecialCharacters.pdf"); - Assert.IsTrue(s[0] > 255); + ClassicAssert.IsTrue(s[0] > 255); } [Test] @@ -453,7 +454,8 @@ public void FillRectangle() doc.Save(Folder + "FillRectangle.pdf"); } - [Test, Ignore("Not implemented")] + [Test] + [Ignore("Not implemented")] public void DrawImage() { var doc = new PortableDocument(); @@ -587,4 +589,4 @@ public void Transparency() doc.Save(Folder + "Transparency.pdf"); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/PlotController/PlotControllerTests.cs b/Source/OxyPlot.Tests/PlotController/PlotControllerTests.cs index d725bcae4..47a74b0ad 100644 --- a/Source/OxyPlot.Tests/PlotController/PlotControllerTests.cs +++ b/Source/OxyPlot.Tests/PlotController/PlotControllerTests.cs @@ -10,8 +10,8 @@ namespace OxyPlot.Tests { using System.Linq; - using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Tests the class. @@ -32,7 +32,7 @@ public void UnbindLeftMouseButton() { var c = new PlotController(); c.Unbind(new OxyMouseDownGesture(OxyMouseButton.Left)); - Assert.IsFalse(c.InputCommandBindings.Any(b => b.Gesture.Equals(new OxyMouseDownGesture(OxyMouseButton.Left)))); + ClassicAssert.IsFalse(c.InputCommandBindings.Any(b => b.Gesture.Equals(new OxyMouseDownGesture(OxyMouseButton.Left)))); } /// @@ -43,7 +43,7 @@ public void UnbindPlotCommand() { var c = new PlotController(); c.Unbind(PlotCommands.SnapTrack); - Assert.IsFalse(c.InputCommandBindings.Any(b => b.Command == PlotCommands.SnapTrack)); + ClassicAssert.IsFalse(c.InputCommandBindings.Any(b => b.Command == PlotCommands.SnapTrack)); } /// @@ -54,8 +54,8 @@ public void UnbindAll() { var c = new PlotController(); c.UnbindAll(); - Assert.AreEqual(0, c.InputCommandBindings.Count); + ClassicAssert.AreEqual(0, c.InputCommandBindings.Count); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/PlotModel/PlotModelTests.cs b/Source/OxyPlot.Tests/PlotModel/PlotModelTests.cs index 9a9318bd7..56fb91f6b 100644 --- a/Source/OxyPlot.Tests/PlotModel/PlotModelTests.cs +++ b/Source/OxyPlot.Tests/PlotModel/PlotModelTests.cs @@ -11,13 +11,10 @@ namespace OxyPlot.Tests { using System; using System.Diagnostics.CodeAnalysis; - using ExampleLibrary; - using NSubstitute; - using NUnit.Framework; - + using NUnit.Framework.Legacy; using OxyPlot.Axes; using OxyPlot.Series; @@ -71,19 +68,20 @@ public void B11_Backgrounds() } [Test] + [Ignore("Garbage collection tests are no longer reliable")] public void PlotControl_CollectedPlotControl_ReferenceShouldNotBeAlive() { var plot = Substitute.For(); var pm = new PlotModel(); ((IPlotModel)pm).AttachPlotView(plot); - Assert.IsNotNull(pm.PlotView); + ClassicAssert.IsNotNull(pm.PlotView); // ReSharper disable once RedundantAssignment plot = null; GC.Collect(); // Verify that the reference is lost - Assert.IsNull(pm.PlotView); + ClassicAssert.IsNull(pm.PlotView); } /// @@ -128,7 +126,7 @@ public void AddAxisTwice() var model = new PlotModel(); var axis = new LinearAxis(); model.Axes.Add(axis); - Assert.Throws(() => model.Axes.Add(axis)); + Assert.That(() => model.Axes.Add(axis), Throws.InvalidOperationException); } /// @@ -141,7 +139,7 @@ public void AddAxisToDifferentModels() var model2 = new PlotModel(); var axis = new LinearAxis(); model1.Axes.Add(axis); - Assert.Throws(() => model2.Axes.Add(axis)); + Assert.That(() => model2.Axes.Add(axis), Throws.InvalidOperationException); } } @@ -160,8 +158,8 @@ public void InvalidAxisKey() model.Axes.Add(new LinearAxis()); model.Series.Add(new LineSeries { XAxisKey = "invalidKey" }); ((IPlotModel)model).Update(true); - Assert.IsNotNull(model.GetLastUpdateException() as InvalidOperationException); + ClassicAssert.IsNotNull(model.GetLastUpdateException() as InvalidOperationException); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Rendering/Utilities/DecimatorTests.cs b/Source/OxyPlot.Tests/Rendering/Utilities/DecimatorTests.cs index dcf5fa4f4..7e322fc1c 100644 --- a/Source/OxyPlot.Tests/Rendering/Utilities/DecimatorTests.cs +++ b/Source/OxyPlot.Tests/Rendering/Utilities/DecimatorTests.cs @@ -11,8 +11,8 @@ namespace OxyPlot.Tests.Rendering.Utilities { using System; using System.Collections.Generic; - using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Provides unit tests for the class. @@ -36,7 +36,7 @@ public void Decimate() } Decimator.Decimate(input, output); - Assert.AreEqual(6, output.Count); + ClassicAssert.AreEqual(6, output.Count); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Svg/SvgExporterTests.cs b/Source/OxyPlot.Tests/Svg/SvgExporterTests.cs index 5338075ff..6cb83c6ca 100644 --- a/Source/OxyPlot.Tests/Svg/SvgExporterTests.cs +++ b/Source/OxyPlot.Tests/Svg/SvgExporterTests.cs @@ -9,10 +9,9 @@ namespace OxyPlot.Tests using System; using System.Diagnostics.CodeAnalysis; using System.IO; - using ExampleLibrary; using NUnit.Framework; - + using NUnit.Framework.Legacy; using OxyPlot.Series; // ReSharper disable InconsistentNaming @@ -74,8 +73,8 @@ public void Export_AllExamplesInExampleLibrary_CheckThatAllFilesExist() SvgExporter.Export(example.PlotModel, s, 800, 500, true); } - Assert.IsTrue(File.Exists(path)); + ClassicAssert.IsTrue(File.Exists(path)); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Utilities/ArrayBuilderTests.cs b/Source/OxyPlot.Tests/Utilities/ArrayBuilderTests.cs index 52e00f7c2..2b79913d6 100644 --- a/Source/OxyPlot.Tests/Utilities/ArrayBuilderTests.cs +++ b/Source/OxyPlot.Tests/Utilities/ArrayBuilderTests.cs @@ -8,8 +8,8 @@ namespace OxyPlot.Tests { using System.Diagnostics.CodeAnalysis; using System.Linq; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -20,24 +20,24 @@ public class ArrayBuilderTests public void CreateVector_ByDelta_ReturnsExpectedArray() { var v = ArrayBuilder.CreateVector(0, 1, 0.1); - Assert.AreEqual(11, v.Length); - Assert.AreEqual(0, v[0]); - Assert.AreEqual(0.3, v[3]); - Assert.AreEqual(0.6, v[6]); - Assert.AreEqual(0.7, v[7]); - Assert.AreEqual(1, v[10]); + ClassicAssert.AreEqual(11, v.Length); + ClassicAssert.AreEqual(0, v[0]); + ClassicAssert.AreEqual(0.3, v[3]); + ClassicAssert.AreEqual(0.6, v[6]); + ClassicAssert.AreEqual(0.7, v[7]); + ClassicAssert.AreEqual(1, v[10]); } [Test] public void CreateVector_ByNumberOfSteps_ReturnsExpectedArray() { var v = ArrayBuilder.CreateVector(0, 1, 11); - Assert.AreEqual(11, v.Length); - Assert.AreEqual(0, v[0]); - Assert.AreEqual(0.3, v[3]); - Assert.AreEqual(0.6, v[6]); - Assert.AreEqual(0.7, v[7]); - Assert.AreEqual(1, v[10]); + ClassicAssert.AreEqual(11, v.Length); + ClassicAssert.AreEqual(0, v[0]); + ClassicAssert.AreEqual(0.3, v[3]); + ClassicAssert.AreEqual(0.6, v[6]); + ClassicAssert.AreEqual(0.7, v[7]); + ClassicAssert.AreEqual(1, v[10]); } [Test] @@ -47,34 +47,34 @@ public void Evaluate() var yvector = ArrayBuilder.CreateVector(0, 1, 0.1); var dvector = ArrayBuilder.Evaluate((x, y) => x * y, xvector, yvector); - Assert.AreEqual(10, dvector.GetUpperBound(0)); - Assert.AreEqual(10, dvector.GetUpperBound(1)); - Assert.AreEqual(0, dvector[0, 0]); - Assert.AreEqual(1, dvector[10, 10]); - Assert.AreEqual(0.3 * 0.4, dvector[3, 4]); + ClassicAssert.AreEqual(10, dvector.GetUpperBound(0)); + ClassicAssert.AreEqual(10, dvector.GetUpperBound(1)); + ClassicAssert.AreEqual(0, dvector[0, 0]); + ClassicAssert.AreEqual(1, dvector[10, 10]); + ClassicAssert.AreEqual(0.3 * 0.4, dvector[3, 4]); } [Test] public void Min2D() { var array1 = new double[,] { { 4, 2 } }; - Assert.AreEqual(2, array1.Min2D(), "Min2D()"); + ClassicAssert.AreEqual(2, array1.Min2D(), "Min2D()"); var array2 = new[,] { { 4, double.NaN } }; - Assert.AreEqual(double.NaN, array2.Min2D(), "Min2D() with NaN"); - Assert.AreEqual(4, array2.Min2D(true), "Min2D(true) with NaN"); + ClassicAssert.AreEqual(double.NaN, array2.Min2D(), "Min2D() with NaN"); + ClassicAssert.AreEqual(4, array2.Min2D(true), "Min2D(true) with NaN"); var array3 = new[] { 4, double.NaN }; - Assert.AreEqual(double.NaN, array3.Min(), "LINQ Min()"); + ClassicAssert.AreEqual(double.NaN, array3.Min(), "LINQ Min()"); } [Test] public void Max2D() { var array1 = new double[,] { { 4, 2 } }; - Assert.AreEqual(4, array1.Max2D(), "Max2D()"); + ClassicAssert.AreEqual(4, array1.Max2D(), "Max2D()"); var array2 = new[,] { { 4, double.NaN } }; - Assert.AreEqual(4, array2.Max2D(), "Max2D() with NaN"); + ClassicAssert.AreEqual(4, array2.Max2D(), "Max2D() with NaN"); var array3 = new[] { 4, double.NaN }; - Assert.AreEqual(4, array3.Max(), "LINQ Max()"); + ClassicAssert.AreEqual(4, array3.Max(), "LINQ Max()"); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Utilities/ConrecTests.cs b/Source/OxyPlot.Tests/Utilities/ConrecTests.cs index 52e9eefd4..f67090c5a 100644 --- a/Source/OxyPlot.Tests/Utilities/ConrecTests.cs +++ b/Source/OxyPlot.Tests/Utilities/ConrecTests.cs @@ -8,8 +8,8 @@ namespace OxyPlot.Tests { using System; using System.Diagnostics.CodeAnalysis; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -25,7 +25,7 @@ public void Contour() var data = ArrayBuilder.Evaluate((x1, y1) => Math.Sin(x1 * y1), x, y); int segments = 0; Conrec.Contour(data, x, y, z, (x1, y1, x2, y2, elev) => { segments++; }); - Assert.AreEqual(134068, segments); + ClassicAssert.AreEqual(134068, segments); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Utilities/FractionHelperTests.cs b/Source/OxyPlot.Tests/Utilities/FractionHelperTests.cs index 4d28b846d..1777cb0d1 100644 --- a/Source/OxyPlot.Tests/Utilities/FractionHelperTests.cs +++ b/Source/OxyPlot.Tests/Utilities/FractionHelperTests.cs @@ -8,8 +8,8 @@ namespace OxyPlot.Tests { using System; using System.Diagnostics.CodeAnalysis; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -19,13 +19,13 @@ public class FractionHelperTests [Test] public void ConvertToFractionString() { - Assert.AreEqual("3/4", FractionHelper.ConvertToFractionString(0.75)); + ClassicAssert.AreEqual("3/4", FractionHelper.ConvertToFractionString(0.75)); } [Test] public void ConvertToFractionString_WithUnit() { - Assert.AreEqual("2pi", FractionHelper.ConvertToFractionString(Math.PI * 2, Math.PI, "pi")); + ClassicAssert.AreEqual("2pi", FractionHelper.ConvertToFractionString(Math.PI * 2, Math.PI, "pi")); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Utilities/ListFillerTests.cs b/Source/OxyPlot.Tests/Utilities/ListFillerTests.cs index a4270a1e1..e4731032e 100644 --- a/Source/OxyPlot.Tests/Utilities/ListFillerTests.cs +++ b/Source/OxyPlot.Tests/Utilities/ListFillerTests.cs @@ -9,9 +9,8 @@ namespace OxyPlot.Tests using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - using NUnit.Framework; - + using NUnit.Framework.Legacy; using OxyPlot.Series; // ReSharper disable InconsistentNaming @@ -36,18 +35,23 @@ public void Fill() filler.Add("A", (p, v) => p.X = Convert.ToDouble(v)); filler.Fill(target, this.src); - Assert.AreEqual(1, target.Count); - Assert.AreEqual(3.14, target[0].X); + ClassicAssert.AreEqual(1, target.Count); + ClassicAssert.AreEqual(3.14, target[0].X); } - [Test, ExpectedException] + [Test] public void Fill_InvalidProperty_ThrowsException() { var target = new List(); var filler = new ListFiller(); - filler.Add("B", (p, v) => p.X = Convert.ToDouble(v)); - filler.Fill(target, this.src); + Assert.That( + () => + { + filler.Add("B", (p, v) => p.X = Convert.ToDouble(v)); + filler.Fill(target, this.src); + }, + Throws.Exception); } [Test] @@ -59,8 +63,8 @@ public void Fill_NullProperty_IsIgnored() filler.Add(null, (p, v) => { }); filler.Fill(target, this.src); - Assert.AreEqual(1, target.Count); - Assert.AreEqual(0, target[0].X); + ClassicAssert.AreEqual(1, target.Count); + ClassicAssert.AreEqual(0, target[0].X); } private class TestObject @@ -68,4 +72,4 @@ private class TestObject public double A { get; set; } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Tests/Utilities/StringHelperTests.cs b/Source/OxyPlot.Tests/Utilities/StringHelperTests.cs index c731a4894..46e7efebf 100644 --- a/Source/OxyPlot.Tests/Utilities/StringHelperTests.cs +++ b/Source/OxyPlot.Tests/Utilities/StringHelperTests.cs @@ -9,8 +9,8 @@ namespace OxyPlot.Tests using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; - using NUnit.Framework; + using NUnit.Framework.Legacy; // ReSharper disable InconsistentNaming [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")] @@ -20,19 +20,19 @@ public class StringHelperTests [Test] public void Format_StandardFormatString() { - Assert.AreEqual("3.1", StringHelper.Format(CultureInfo.InvariantCulture, "{0}", null, 3.1)); - Assert.AreEqual("3.14", StringHelper.Format(CultureInfo.InvariantCulture, "{0:0.00}", null, Math.PI)); - Assert.AreEqual("PI=3.14", StringHelper.Format(CultureInfo.InvariantCulture, "PI={0:0.00}", null, Math.PI)); + ClassicAssert.AreEqual("3.1", StringHelper.Format(CultureInfo.InvariantCulture, "{0}", null, 3.1)); + ClassicAssert.AreEqual("3.14", StringHelper.Format(CultureInfo.InvariantCulture, "{0:0.00}", null, Math.PI)); + ClassicAssert.AreEqual("PI=3.14", StringHelper.Format(CultureInfo.InvariantCulture, "PI={0:0.00}", null, Math.PI)); } [Test] public void Format_Item() { var item = new Item { Text = "Hello World", Value = 3.14 }; - Assert.AreEqual( + ClassicAssert.AreEqual( "3.14 3 Hello World 3.140", StringHelper.Format(CultureInfo.InvariantCulture, "{0} {1:0} {Text} {Value:0.000}", item, item.Value, item.Value)); - Assert.AreEqual( + ClassicAssert.AreEqual( "Hello World", StringHelper.Format(CultureInfo.InvariantCulture, "{Text}", item)); } @@ -44,4 +44,4 @@ public class Item public double Value { get; set; } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Wpf.Tests/Axes/LinearAxisTests.cs b/Source/OxyPlot.Wpf.Tests/Axes/LinearAxisTests.cs index 050d8f6e0..5abeedd10 100644 --- a/Source/OxyPlot.Wpf.Tests/Axes/LinearAxisTests.cs +++ b/Source/OxyPlot.Wpf.Tests/Axes/LinearAxisTests.cs @@ -10,6 +10,7 @@ namespace OxyPlot.Wpf.Tests { using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Provides unit tests for the class. @@ -29,15 +30,15 @@ public void CompareTitleProperties() { var axis = new Axes.LinearAxis(); var wpfAxis = new LinearAxis(); - Assert.AreEqual(axis.TitleColor, wpfAxis.TitleColor.ToOxyColor(), "TitleColor"); - Assert.AreEqual(axis.Title, wpfAxis.Title, "Title"); - Assert.AreEqual(axis.TitleClippingLength, wpfAxis.TitleClippingLength, "TitleClippingLength"); - Assert.AreEqual(axis.TitleFont, wpfAxis.TitleFont, "TitleFont"); - Assert.AreEqual(axis.TitleFontSize, wpfAxis.TitleFontSize, "TitleFontSize"); - Assert.AreEqual(axis.TitleFontWeight, wpfAxis.TitleFontWeight.ToOpenTypeWeight(), "TitleFontWeight"); - Assert.AreEqual(axis.TitleFormatString, wpfAxis.TitleFormatString, "TitleFormatString"); - Assert.AreEqual(axis.TitlePosition, wpfAxis.TitlePosition, "TitlePosition"); + ClassicAssert.AreEqual(axis.TitleColor, wpfAxis.TitleColor.ToOxyColor(), "TitleColor"); + ClassicAssert.AreEqual(axis.Title, wpfAxis.Title, "Title"); + ClassicAssert.AreEqual(axis.TitleClippingLength, wpfAxis.TitleClippingLength, "TitleClippingLength"); + ClassicAssert.AreEqual(axis.TitleFont, wpfAxis.TitleFont, "TitleFont"); + ClassicAssert.AreEqual(axis.TitleFontSize, wpfAxis.TitleFontSize, "TitleFontSize"); + ClassicAssert.AreEqual(axis.TitleFontWeight, wpfAxis.TitleFontWeight.ToOpenTypeWeight(), "TitleFontWeight"); + ClassicAssert.AreEqual(axis.TitleFormatString, wpfAxis.TitleFormatString, "TitleFormatString"); + ClassicAssert.AreEqual(axis.TitlePosition, wpfAxis.TitlePosition, "TitlePosition"); } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Wpf.Tests/OxyAssert.cs b/Source/OxyPlot.Wpf.Tests/OxyAssert.cs index 0b1a010e1..53d5f8c95 100644 --- a/Source/OxyPlot.Wpf.Tests/OxyAssert.cs +++ b/Source/OxyPlot.Wpf.Tests/OxyAssert.cs @@ -16,8 +16,8 @@ namespace OxyPlot.Wpf.Tests using System.Linq; using System.Windows; using System.Windows.Media; - using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Provides specialized unit test assertion methods. @@ -53,7 +53,7 @@ public static void PropertiesExist(Type t1, Type t2, bool failOnMissingProperty } } - Assert.IsTrue(result); + ClassicAssert.IsTrue(result); } /// @@ -145,7 +145,7 @@ public static void PropertiesAreEqual(object o1, object o2, Type testType1 = nul result = false; } - Assert.IsTrue(result); + ClassicAssert.IsTrue(result); } /// @@ -267,4 +267,4 @@ private static bool AreEqual(IList v1, IList v2) return true; } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Wpf.Tests/OxyPlot.Wpf.Tests.core.csproj b/Source/OxyPlot.Wpf.Tests/OxyPlot.Wpf.Tests.core.csproj new file mode 100644 index 000000000..f486a6504 --- /dev/null +++ b/Source/OxyPlot.Wpf.Tests/OxyPlot.Wpf.Tests.core.csproj @@ -0,0 +1,48 @@ + + + net8.0-windows + Library + OxyPlot.Wpf.Tests + OxyPlot.Wpf.Tests + ..\ + false + true + true + + + $(NoWarn),1573,1591,1712 + OxyPlot.Wpf.Tests + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/OxyPlot.Wpf.Tests/PlotViewTests.cs b/Source/OxyPlot.Wpf.Tests/PlotViewTests.cs index f0c8d545d..f414db012 100644 --- a/Source/OxyPlot.Wpf.Tests/PlotViewTests.cs +++ b/Source/OxyPlot.Wpf.Tests/PlotViewTests.cs @@ -13,6 +13,7 @@ namespace OxyPlot.Wpf.Tests using System.Windows; using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Provides unit tests for the class. @@ -28,14 +29,15 @@ public class ActualModel /// /// Gets the actual model when model is not set. /// - [Test, Ignore] + [Test] + [Ignore("because")] public void GetDefault() { var w = new Window(); var plotView = new PlotView(); w.Content = plotView; w.Show(); - Assert.IsNotNull(plotView.ActualModel); + ClassicAssert.IsNotNull(plotView.ActualModel); } /// @@ -46,7 +48,7 @@ public void GetFromSameThread() { var model = new PlotModel(); var plotView = new PlotView { Model = model }; - Assert.AreEqual(model, plotView.ActualModel); + ClassicAssert.AreEqual(model, plotView.ActualModel); } /// @@ -59,7 +61,7 @@ public void GetFromOtherThread() var plotView = new PlotView { Model = model }; PlotModel actualModel = null; Task.Factory.StartNew(() => actualModel = plotView.ActualModel).Wait(); - Assert.AreEqual(model, actualModel); + ClassicAssert.AreEqual(model, actualModel); } } @@ -108,4 +110,4 @@ public void PlotModelVsPlot() } } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Wpf.Tests/PngAssert.cs b/Source/OxyPlot.Wpf.Tests/PngAssert.cs index fb7a859ed..d87252d89 100644 --- a/Source/OxyPlot.Wpf.Tests/PngAssert.cs +++ b/Source/OxyPlot.Wpf.Tests/PngAssert.cs @@ -12,8 +12,8 @@ namespace OxyPlot.Wpf.Tests using System; using System.IO; using System.Windows.Media.Imaging; - using NUnit.Framework; + using NUnit.Framework.Legacy; /// /// Provides assertions on image files. @@ -36,17 +36,17 @@ public static void AreEqual(string expected, string actual, string message, stri { EnsureFolder(expected); File.Copy(actual, expected); - Assert.Fail("File not found: {0}", expected); + ClassicAssert.Fail($"File not found: {expected}"); } if (expectedImage.GetLength(0) != actualImage.GetLength(0)) { - Assert.Fail("Expected height: {0}\nActual height:{1}\n{2}", expectedImage.GetLength(0), actualImage.GetLength(0), message); + Assert.Fail(string.Format("Expected height: {0}\nActual height:{1}\n{2}", expectedImage.GetLength(0), actualImage.GetLength(0), message)); } if (expectedImage.GetLength(1) != actualImage.GetLength(1)) { - Assert.Fail("Expected width: {0}\nActual width:{1}\n{2}", expectedImage.GetLength(1), actualImage.GetLength(1), message); + Assert.Fail(string.Format("Expected width: {0}\nActual width:{1}\n{2}", expectedImage.GetLength(1), actualImage.GetLength(1), message)); } var w = expectedImage.GetLength(0); @@ -88,7 +88,7 @@ public static void AreEqual(string expected, string actual, string message, stri File.WriteAllBytes(output, encoder.Encode(differenceImage)); } - Assert.Fail("Pixel differences: {0}\n{1}", differences, message); + Assert.Fail(string.Format("Pixel differences: {0}\n{1}", differences, message)); } } @@ -145,4 +145,4 @@ private static void EnsureFolder(string path) return r; } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Wpf.Tests/PngExporterTests.cs b/Source/OxyPlot.Wpf.Tests/PngExporterTests.cs index 4b704abb9..7d2d7a9ae 100644 --- a/Source/OxyPlot.Wpf.Tests/PngExporterTests.cs +++ b/Source/OxyPlot.Wpf.Tests/PngExporterTests.cs @@ -13,6 +13,7 @@ namespace OxyPlot.Wpf.Tests using System.IO; using NUnit.Framework; + using NUnit.Framework.Legacy; using OxyPlot.Tests; /// @@ -35,7 +36,7 @@ public void ExportToFile() exporter.Export(plotModel, stream); } - Assert.IsTrue(File.Exists(FileName)); + ClassicAssert.IsTrue(File.Exists(FileName)); } /// @@ -52,7 +53,7 @@ public void ExportWithDifferentBackground() exporter.Export(plotModel, stream); } - Assert.IsTrue(File.Exists(FileName)); + ClassicAssert.IsTrue(File.Exists(FileName)); } /// @@ -73,8 +74,8 @@ public void ExportWithResolution(double factor) exporter.Export(plotModel, stream); } - Assert.IsTrue(File.Exists(fileName)); + ClassicAssert.IsTrue(File.Exists(fileName)); PngAssert.AreEqual(Path.Combine("Baseline", fileName), fileName, fileName, Path.Combine("Diff", fileName)); } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot.Wpf.Tests/Properties/AssemblyInfo.cs b/Source/OxyPlot.Wpf.Tests/Properties/AssemblyInfo.cs index 730e1106c..959776a07 100644 --- a/Source/OxyPlot.Wpf.Tests/Properties/AssemblyInfo.cs +++ b/Source/OxyPlot.Wpf.Tests/Properties/AssemblyInfo.cs @@ -8,11 +8,5 @@ using NUnit.Framework; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OxyPlot.Wpf.Tests")] -[assembly: AssemblyDescription("")] - // http://www.nunit.org/index.php?p=requiresSTA&r=2.5 -[assembly: RequiresSTA] \ No newline at end of file +[assembly: Apartment(System.Threading.ApartmentState.STA)] diff --git a/Source/OxyPlot.Wpf/OxyPlot.Wpf.core.csproj b/Source/OxyPlot.Wpf/OxyPlot.Wpf.core.csproj new file mode 100644 index 000000000..fbfccfebe --- /dev/null +++ b/Source/OxyPlot.Wpf/OxyPlot.Wpf.core.csproj @@ -0,0 +1,57 @@ + + + net8.0-windows + Library + OxyPlot.Wpf + OxyPlot.Wpf + true + false + false + true + true + + + $(NoWarn),1573,1591,1712 + + + ..\..\Output\NET45\OxyPlot.Wpf.XML + + + ..\..\Output\NET45\ + TRACE;WPF + ..\..\Output\NET45\OxyPlot.Wpf.XML + + + true + + + OxyPlot.Wpf.snk + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/OxyPlot.Wpf/Properties/Resources.Designer.cs b/Source/OxyPlot.Wpf/Properties/Resources.Designer.cs index d870566f1..980551039 100644 --- a/Source/OxyPlot.Wpf/Properties/Resources.Designer.cs +++ b/Source/OxyPlot.Wpf/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace OxyPlot.Wpf.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/Source/OxyPlot.Wpf/Properties/Settings.Designer.cs b/Source/OxyPlot.Wpf/Properties/Settings.Designer.cs index 0ae7a32d5..b23bc3cd9 100644 --- a/Source/OxyPlot.Wpf/Properties/Settings.Designer.cs +++ b/Source/OxyPlot.Wpf/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace OxyPlot.Wpf.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/Source/OxyPlot.Xps/OxyPlot.Xps.core.csproj b/Source/OxyPlot.Xps/OxyPlot.Xps.core.csproj new file mode 100644 index 000000000..6c9d396f5 --- /dev/null +++ b/Source/OxyPlot.Xps/OxyPlot.Xps.core.csproj @@ -0,0 +1,41 @@ + + + net8.0-windows + Library + OxyPlot.Xps + OxyPlot.Xps + false + true + true + + + $(NoWarn),1573,1591,1712 + + + ..\..\Output\NET45\ + ..\..\Output\NET45\OxyPlot.Xps.XML + + + + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/OxyPlot.core.sln b/Source/OxyPlot.core.sln new file mode 100644 index 000000000..2c0c9810c --- /dev/null +++ b/Source/OxyPlot.core.sln @@ -0,0 +1,82 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36327.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.core", "OxyPlot\OxyPlot.core.csproj", "{27E7D009-F9D1-D1D0-AEA3-17C4C6F6A572}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.Tests.core", "OxyPlot.Tests\OxyPlot.Tests.core.csproj", "{E6218B88-69F5-4E3F-9ABC-93AB82FD77AD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleLibrary.core", "Examples\ExampleLibrary\ExampleLibrary.core.csproj", "{FACB89E5-53A5-4748-9F5B-E0714EBB37B2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.Wpf.core", "OxyPlot.Wpf\OxyPlot.Wpf.core.csproj", "{698CCD8E-ADCC-4565-8517-5EDD36F07155}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.Wpf.Tests.core", "OxyPlot.Wpf.Tests\OxyPlot.Wpf.Tests.core.csproj", "{4ED9A511-669D-47B1-97F5-4FCAFE8EB178}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WPF", "WPF", "{B419C103-1923-4E0B-BF3C-0D55BE2F4962}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfExamples.core", "Examples\WPF\WpfExamples\WpfExamples.core.csproj", "{B86739B8-5DE9-406F-9418-0751BF7C166F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.OpenXml.core", "OxyPlot.OpenXml\OxyPlot.OpenXml.core.csproj", "{BB4FA452-A96A-4C47-AA65-7E88F6FAE873}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.Pdf.core", "OxyPlot.Pdf\OxyPlot.Pdf.core.csproj", "{12737C3F-5770-403F-90A1-BC12EBD1BB31}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OxyPlot.Xps.core", "OxyPlot.Xps\OxyPlot.Xps.core.csproj", "{639E0B40-A307-4D4A-BB78-BE0019D8D7C1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {27E7D009-F9D1-D1D0-AEA3-17C4C6F6A572}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27E7D009-F9D1-D1D0-AEA3-17C4C6F6A572}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27E7D009-F9D1-D1D0-AEA3-17C4C6F6A572}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27E7D009-F9D1-D1D0-AEA3-17C4C6F6A572}.Release|Any CPU.Build.0 = Release|Any CPU + {E6218B88-69F5-4E3F-9ABC-93AB82FD77AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6218B88-69F5-4E3F-9ABC-93AB82FD77AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6218B88-69F5-4E3F-9ABC-93AB82FD77AD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6218B88-69F5-4E3F-9ABC-93AB82FD77AD}.Release|Any CPU.Build.0 = Release|Any CPU + {FACB89E5-53A5-4748-9F5B-E0714EBB37B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FACB89E5-53A5-4748-9F5B-E0714EBB37B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FACB89E5-53A5-4748-9F5B-E0714EBB37B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FACB89E5-53A5-4748-9F5B-E0714EBB37B2}.Release|Any CPU.Build.0 = Release|Any CPU + {698CCD8E-ADCC-4565-8517-5EDD36F07155}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {698CCD8E-ADCC-4565-8517-5EDD36F07155}.Debug|Any CPU.Build.0 = Debug|Any CPU + {698CCD8E-ADCC-4565-8517-5EDD36F07155}.Release|Any CPU.ActiveCfg = Release|Any CPU + {698CCD8E-ADCC-4565-8517-5EDD36F07155}.Release|Any CPU.Build.0 = Release|Any CPU + {4ED9A511-669D-47B1-97F5-4FCAFE8EB178}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4ED9A511-669D-47B1-97F5-4FCAFE8EB178}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4ED9A511-669D-47B1-97F5-4FCAFE8EB178}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4ED9A511-669D-47B1-97F5-4FCAFE8EB178}.Release|Any CPU.Build.0 = Release|Any CPU + {B86739B8-5DE9-406F-9418-0751BF7C166F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B86739B8-5DE9-406F-9418-0751BF7C166F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B86739B8-5DE9-406F-9418-0751BF7C166F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B86739B8-5DE9-406F-9418-0751BF7C166F}.Release|Any CPU.Build.0 = Release|Any CPU + {BB4FA452-A96A-4C47-AA65-7E88F6FAE873}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB4FA452-A96A-4C47-AA65-7E88F6FAE873}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB4FA452-A96A-4C47-AA65-7E88F6FAE873}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB4FA452-A96A-4C47-AA65-7E88F6FAE873}.Release|Any CPU.Build.0 = Release|Any CPU + {12737C3F-5770-403F-90A1-BC12EBD1BB31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12737C3F-5770-403F-90A1-BC12EBD1BB31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12737C3F-5770-403F-90A1-BC12EBD1BB31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12737C3F-5770-403F-90A1-BC12EBD1BB31}.Release|Any CPU.Build.0 = Release|Any CPU + {639E0B40-A307-4D4A-BB78-BE0019D8D7C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {639E0B40-A307-4D4A-BB78-BE0019D8D7C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {639E0B40-A307-4D4A-BB78-BE0019D8D7C1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {639E0B40-A307-4D4A-BB78-BE0019D8D7C1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {FACB89E5-53A5-4748-9F5B-E0714EBB37B2} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {B419C103-1923-4E0B-BF3C-0D55BE2F4962} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {B86739B8-5DE9-406F-9418-0751BF7C166F} = {B419C103-1923-4E0B-BF3C-0D55BE2F4962} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {55982BC1-77E2-4B38-B04E-2A59E4D21F12} + EndGlobalSection +EndGlobal diff --git a/Source/OxyPlot/Graphics/ElementCollection{T}.cs b/Source/OxyPlot/Graphics/ElementCollection{T}.cs index 45365b171..8556d43fc 100644 --- a/Source/OxyPlot/Graphics/ElementCollection{T}.cs +++ b/Source/OxyPlot/Graphics/ElementCollection{T}.cs @@ -106,6 +106,12 @@ IEnumerator IEnumerable.GetEnumerator() /// The element cannot be added, it already belongs to a PlotModel. public void Add(T item) { + if (item.Parent != null) + { + // Copied this from the OxyPlot base repo. This will allow unit tests to pass. + throw new InvalidOperationException("The element cannot be added, it already belongs to a PlotModel."); + } + if (item.Parent == null && !IsCustomLegendSeries) { item.Parent = this.parent; diff --git a/Source/OxyPlot/Imaging/Jpeg/JpegDecoder.cs b/Source/OxyPlot/Imaging/Jpeg/JpegDecoder.cs index 2e92229d1..2d1c9e83b 100644 --- a/Source/OxyPlot/Imaging/Jpeg/JpegDecoder.cs +++ b/Source/OxyPlot/Imaging/Jpeg/JpegDecoder.cs @@ -423,5 +423,10 @@ private static object ReadValue( { throw new NotImplementedException(); } + + OxyColor[,] IImageDecoder.Decode(byte[] bytes) + { + throw new NotImplementedException(); + } } -} \ No newline at end of file +} diff --git a/Source/OxyPlot/OxyPlot.core.csproj b/Source/OxyPlot/OxyPlot.core.csproj new file mode 100644 index 000000000..2a6f0e59e --- /dev/null +++ b/Source/OxyPlot/OxyPlot.core.csproj @@ -0,0 +1,21 @@ + + + + netstandard2.0 + OxyPlot + OxyPlot + 10.0.0 + false + + + true + + + OxyPlot.snk + + + + Properties\GlobalAssemblyInfo.cs + + + From 42f064314d6223725acb1539ff0b2a2b681ed9a0 Mon Sep 17 00:00:00 2001 From: Henry LaFleur Date: Wed, 1 Oct 2025 16:40:57 -0500 Subject: [PATCH 2/5] Fix copy file --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8b5da17d1..eb096680f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,8 +27,8 @@ steps: - task: CopyFiles@1 displayName: 'Copy Files to: $(Build.SourcesDirectory)' inputs: - SourceFolder: ' $(DevelopmentFolder)\nuspec\evoleap.OxyPlot.core.Wpf' - Contents: evoleap.OxyPlot.Wpf.nuspec + SourceFolder: ' $(DevelopmentFolder)\nuspec\evoleap.OxyPlot.Wpf' + Contents: evoleap.OxyPlot.Wpf.core.nuspec TargetFolder: '$(Build.SourcesDirectory)' - task: CmdLine@1 displayName: 'Write WorkingVersion.txt' From f3b9b408d6b68df1db12d6923f3bee9861784868 Mon Sep 17 00:00:00 2001 From: Henry LaFleur Date: Wed, 1 Oct 2025 16:44:15 -0500 Subject: [PATCH 3/5] Disabling .NET 4 build --- azure-pipelines.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eb096680f..ecfe06e76 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -61,11 +61,13 @@ steps: restoreSolution: 'Source/OxyPlot.WPF.sln;Source/OxyPlot.WPF_NET40.sln' vstsFeed: '4e2dc0fe-c532-420e-8889-18ca9bea1ff1' - task: DotNetCoreCLI@2 + enabled: false inputs: command: 'restore' projects: 'Source/OxyPlot.core.sln' feedsToUse: 'select' - task: MSBuild@1 + enabled: false displayName: 'Build solution Source/OxyPlot.WPF.sln' inputs: solution: Source/OxyPlot.WPF.sln @@ -77,10 +79,11 @@ steps: inputs: command: 'build' projects: 'Source/OxyPlot.core.sln' -- task: NuGetPackager@0 - displayName: 'NuGet Packager ' - inputs: - searchPattern: evoleap.OxyPlot.Wpf.nuspec +#- task: NuGetPackager@0 +# enabled: false +# displayName: 'NuGet Packager ' +# inputs: +# searchPattern: evoleap.OxyPlot.Wpf.nuspec - task: DotNetCoreCLI@2 inputs: command: 'pack' From 69766a64339e778bb2648d834f858a22d1e83ae8 Mon Sep 17 00:00:00 2001 From: Henry LaFleur Date: Wed, 1 Oct 2025 16:49:01 -0500 Subject: [PATCH 4/5] Update NuGet pack command --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ecfe06e76..d349e6df4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -84,11 +84,11 @@ steps: # displayName: 'NuGet Packager ' # inputs: # searchPattern: evoleap.OxyPlot.Wpf.nuspec -- task: DotNetCoreCLI@2 +- task: NuGetCommand@2 inputs: command: 'pack' packagesToPack: 'evoleap.OxyPlot.Wpf.core.nuspec' - packDirectory: '$(Build.SourcesDirectory)' + packDestination: '$(Build.SourcesDirectory)' versioningScheme: 'off' - task: NuGetCommand@2 displayName: 'NuGet push' From fab71c0f58f3127642d9ac7df5fd0d464760d884 Mon Sep 17 00:00:00 2001 From: Henry LaFleur Date: Wed, 1 Oct 2025 17:00:25 -0500 Subject: [PATCH 5/5] Add OxyPlot documentation --- Source/OxyPlot/OxyPlot.core.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/OxyPlot/OxyPlot.core.csproj b/Source/OxyPlot/OxyPlot.core.csproj index 2a6f0e59e..a90decaa5 100644 --- a/Source/OxyPlot/OxyPlot.core.csproj +++ b/Source/OxyPlot/OxyPlot.core.csproj @@ -6,6 +6,10 @@ OxyPlot 10.0.0 false + true + + + $(NoWarn),1573,1591,1712 true