From 75e9046c16559c272e1740366ef309aac6150b85 Mon Sep 17 00:00:00 2001 From: BobLd Date: Sat, 23 May 2020 20:33:00 +0100 Subject: [PATCH] add DlaHelper for tests and correct minor typos --- src/UglyToad.PdfPig.Tests/Dla/DlaHelper.cs | 20 +++++++++++++++++++ src/UglyToad.PdfPig.Tests/Dla/KdTreeTests.cs | 1 - .../Dla/MathExtensionsTests.cs | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/UglyToad.PdfPig.Tests/Dla/DlaHelper.cs diff --git a/src/UglyToad.PdfPig.Tests/Dla/DlaHelper.cs b/src/UglyToad.PdfPig.Tests/Dla/DlaHelper.cs new file mode 100644 index 00000000..eaae4899 --- /dev/null +++ b/src/UglyToad.PdfPig.Tests/Dla/DlaHelper.cs @@ -0,0 +1,20 @@ +namespace UglyToad.PdfPig.Tests.Dla +{ + using System; + using System.IO; + + internal static class DlaHelper + { + public static string GetDocumentPath(string name, bool isPdf = true) + { + var documentFolder = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "Dla", "Documents")); + + if (!name.EndsWith(".pdf") && isPdf) + { + name += ".pdf"; + } + + return Path.Combine(documentFolder, name); + } + } +} \ No newline at end of file diff --git a/src/UglyToad.PdfPig.Tests/Dla/KdTreeTests.cs b/src/UglyToad.PdfPig.Tests/Dla/KdTreeTests.cs index 3714f4aa..bb963a48 100644 --- a/src/UglyToad.PdfPig.Tests/Dla/KdTreeTests.cs +++ b/src/UglyToad.PdfPig.Tests/Dla/KdTreeTests.cs @@ -6727,7 +6727,6 @@ // root -> right side -> right side Assert.Null(kdTree.Root.RightChild.RightChild); - } [Theory] diff --git a/src/UglyToad.PdfPig.Tests/Dla/MathExtensionsTests.cs b/src/UglyToad.PdfPig.Tests/Dla/MathExtensionsTests.cs index 8f589813..57c73757 100644 --- a/src/UglyToad.PdfPig.Tests/Dla/MathExtensionsTests.cs +++ b/src/UglyToad.PdfPig.Tests/Dla/MathExtensionsTests.cs @@ -183,7 +183,7 @@ var dataFloat = data.Select(x => (float)x); Assert.Equal((float)expected, dataFloat.Mode(), PreciseDoubleComparer); } - + [Theory] [MemberData(nameof(ModeDataNaN))] public void ModeNaN(double[] data)