summaryrefslogtreecommitdiff
path: root/src/SMAPI.Tests/Toolkit/PathUtilitiesTests.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-08 18:14:04 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-08 18:14:04 -0400
commit8a319e94c8619aeb1dfff239c31c7e0b22b053f4 (patch)
tree2a9fcb5338a9abe6930cb05a1e791c36f46358c0 /src/SMAPI.Tests/Toolkit/PathUtilitiesTests.cs
parent7580f87029ac9f778ec632c7ccaed489d7ca1364 (diff)
downloadSMAPI-8a319e94c8619aeb1dfff239c31c7e0b22b053f4.tar.gz
SMAPI-8a319e94c8619aeb1dfff239c31c7e0b22b053f4.tar.bz2
SMAPI-8a319e94c8619aeb1dfff239c31c7e0b22b053f4.zip
delete redundant unit tests
Diffstat (limited to 'src/SMAPI.Tests/Toolkit/PathUtilitiesTests.cs')
-rw-r--r--src/SMAPI.Tests/Toolkit/PathUtilitiesTests.cs70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/SMAPI.Tests/Toolkit/PathUtilitiesTests.cs b/src/SMAPI.Tests/Toolkit/PathUtilitiesTests.cs
deleted file mode 100644
index 8ec33bcf..00000000
--- a/src/SMAPI.Tests/Toolkit/PathUtilitiesTests.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using NUnit.Framework;
-using StardewModdingAPI.Toolkit.Utilities;
-
-namespace SMAPI.Tests.Toolkit
-{
- /// <summary>Unit tests for <see cref="PathUtilities"/>.</summary>
- [TestFixture]
- public class PathUtilitiesTests
- {
- /*********
- ** Unit tests
- *********/
- [Test(Description = "Assert that GetSegments returns the expected values.")]
- [TestCase("", ExpectedResult = "")]
- [TestCase("/", ExpectedResult = "")]
- [TestCase("///", ExpectedResult = "")]
- [TestCase("/usr/bin", ExpectedResult = "usr|bin")]
- [TestCase("/usr//bin//", ExpectedResult = "usr|bin")]
- [TestCase("/usr//bin//.././boop.exe", ExpectedResult = "usr|bin|..|.|boop.exe")]
- [TestCase(@"C:", ExpectedResult = "C:")]
- [TestCase(@"C:/boop", ExpectedResult = "C:|boop")]
- [TestCase(@"C:\boop\/usr//bin//.././boop.exe", ExpectedResult = "C:|boop|usr|bin|..|.|boop.exe")]
- public string GetSegments(string path)
- {
- return string.Join("|", PathUtilities.GetSegments(path));
- }
-
- [Test(Description = "Assert that NormalizePathSeparators returns the expected values.")]
-#if SMAPI_FOR_WINDOWS
- [TestCase("", ExpectedResult = "")]
- [TestCase("/", ExpectedResult = "")]
- [TestCase("///", ExpectedResult = "")]
- [TestCase("/usr/bin", ExpectedResult = @"usr\bin")]
- [TestCase("/usr//bin//", ExpectedResult = @"usr\bin")]
- [TestCase("/usr//bin//.././boop.exe", ExpectedResult = @"usr\bin\..\.\boop.exe")]
- [TestCase("C:", ExpectedResult = "C:")]
- [TestCase("C:/boop", ExpectedResult = @"C:\boop")]
- [TestCase(@"C:\usr\bin//.././boop.exe", ExpectedResult = @"C:\usr\bin\..\.\boop.exe")]
-#else
- [TestCase("", ExpectedResult = "")]
- [TestCase("/", ExpectedResult = "/")]
- [TestCase("///", ExpectedResult = "/")]
- [TestCase("/usr/bin", ExpectedResult = "/usr/bin")]
- [TestCase("/usr//bin//", ExpectedResult = "/usr/bin")]
- [TestCase("/usr//bin//.././boop.exe", ExpectedResult = "/usr/bin/.././boop.exe")]
- [TestCase("C:", ExpectedResult = "C:")]
- [TestCase("C:/boop", ExpectedResult = "C:/boop")]
- [TestCase(@"C:\usr\bin//.././boop.exe", ExpectedResult = "C:/usr/bin/.././boop.exe")]
-#endif
- public string NormalizePath(string path)
- {
- return PathUtilities.NormalizePath(path);
- }
-
- [Test(Description = "Assert that GetRelativePath returns the expected values.")]
-#if SMAPI_FOR_WINDOWS
- [TestCase(@"C:\", @"C:\", ExpectedResult = "./")]
- [TestCase(@"C:\grandparent\parent\child", @"C:\grandparent\parent\sibling", ExpectedResult = @"..\sibling")]
- [TestCase(@"C:\grandparent\parent\child", @"C:\cousin\file.exe", ExpectedResult = @"..\..\..\cousin\file.exe")]
-#else
- [TestCase("/", "/", ExpectedResult = "./")]
- [TestCase("/grandparent/parent/child", "/grandparent/parent/sibling", ExpectedResult = "../sibling")]
- [TestCase("/grandparent/parent/child", "/cousin/file.exe", ExpectedResult = "../../../cousin/file.exe")]
-#endif
- public string GetRelativePath(string sourceDir, string targetPath)
- {
- return PathUtilities.GetRelativePath(sourceDir, targetPath);
- }
- }
-}