summaryrefslogtreecommitdiff
path: root/src/SMAPI.Tests/Core/ModResolverTests.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-07-20 14:54:56 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-14 18:53:37 -0400
commit673ef91cc75e3b460acb8ab875d4d9d0be07042e (patch)
tree59b6e301af984379c7b199b604ad909de9ab2cf7 /src/SMAPI.Tests/Core/ModResolverTests.cs
parentec747b518b28184c440dcea7ce74f3e80b627505 (diff)
downloadSMAPI-673ef91cc75e3b460acb8ab875d4d9d0be07042e.tar.gz
SMAPI-673ef91cc75e3b460acb8ab875d4d9d0be07042e.tar.bz2
SMAPI-673ef91cc75e3b460acb8ab875d4d9d0be07042e.zip
show versions in duplicate-mod errors, make folder paths in trace logs clearer
Diffstat (limited to 'src/SMAPI.Tests/Core/ModResolverTests.cs')
-rw-r--r--src/SMAPI.Tests/Core/ModResolverTests.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/SMAPI.Tests/Core/ModResolverTests.cs b/src/SMAPI.Tests/Core/ModResolverTests.cs
index 4a1f04c6..ee1c0b99 100644
--- a/src/SMAPI.Tests/Core/ModResolverTests.cs
+++ b/src/SMAPI.Tests/Core/ModResolverTests.cs
@@ -27,7 +27,7 @@ namespace StardewModdingAPI.Tests.Core
public void ReadBasicManifest_NoMods_ReturnsEmptyList()
{
// arrange
- string rootFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
+ string rootFolder = this.GetTempFolderPath();
Directory.CreateDirectory(rootFolder);
// act
@@ -41,7 +41,7 @@ namespace StardewModdingAPI.Tests.Core
public void ReadBasicManifest_EmptyModFolder_ReturnsFailedManifest()
{
// arrange
- string rootFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
+ string rootFolder = this.GetTempFolderPath();
string modFolder = Path.Combine(rootFolder, Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(modFolder);
@@ -78,7 +78,7 @@ namespace StardewModdingAPI.Tests.Core
};
// write to filesystem
- string rootFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
+ string rootFolder = this.GetTempFolderPath();
string modFolder = Path.Combine(rootFolder, Guid.NewGuid().ToString("N"));
string filename = Path.Combine(modFolder, "manifest.json");
Directory.CreateDirectory(modFolder);
@@ -209,7 +209,7 @@ namespace StardewModdingAPI.Tests.Core
IManifest manifest = this.GetManifest();
// create DLL
- string modFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
+ string modFolder = Path.Combine(this.GetTempFolderPath(), Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(modFolder);
File.WriteAllText(Path.Combine(modFolder, manifest.EntryDll), "");
@@ -462,6 +462,12 @@ namespace StardewModdingAPI.Tests.Core
/*********
** Private methods
*********/
+ /// <summary>Get a generated folder path in the temp folder. This folder isn't created automatically.</summary>
+ private string GetTempFolderPath()
+ {
+ return Path.Combine(Path.GetTempPath(), "smapi-unit-tests", Guid.NewGuid().ToString("N"));
+ }
+
/// <summary>Get a randomised basic manifest.</summary>
/// <param name="id">The <see cref="IManifest.UniqueID"/> value, or <c>null</c> for a generated value.</param>
/// <param name="name">The <see cref="IManifest.Name"/> value, or <c>null</c> for a generated value.</param>