summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI.Tests
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-05-16 23:04:38 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-05-16 23:04:38 -0400
commit89d7a3f846b3f380c43656e02ba645d57bef03ea (patch)
tree38e6a7fa1c0298705a1c765f008df3db94645483 /src/StardewModdingAPI.Tests
parentbf02c54f8bc4499052af8870e080100a4a7f05a3 (diff)
downloadSMAPI-89d7a3f846b3f380c43656e02ba645d57bef03ea.tar.gz
SMAPI-89d7a3f846b3f380c43656e02ba645d57bef03ea.tar.bz2
SMAPI-89d7a3f846b3f380c43656e02ba645d57bef03ea.zip
add compile flag for experimental mod dependencies features
Diffstat (limited to 'src/StardewModdingAPI.Tests')
-rw-r--r--src/StardewModdingAPI.Tests/ModResolverTests.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Tests/ModResolverTests.cs b/src/StardewModdingAPI.Tests/ModResolverTests.cs
index 1142a264..efa6fa06 100644
--- a/src/StardewModdingAPI.Tests/ModResolverTests.cs
+++ b/src/StardewModdingAPI.Tests/ModResolverTests.cs
@@ -70,7 +70,9 @@ namespace StardewModdingAPI.Tests
[nameof(IManifest.UniqueID)] = $"{Sample.String()}.{Sample.String()}",
[nameof(IManifest.EntryDll)] = $"{Sample.String()}.dll",
[nameof(IManifest.MinimumApiVersion)] = $"{Sample.Int()}.{Sample.Int()}-{Sample.String()}",
+#if EXPERIMENTAL
[nameof(IManifest.Dependencies)] = new[] { originalDependency },
+#endif
["ExtraString"] = Sample.String(),
["ExtraInt"] = Sample.Int()
};
@@ -107,9 +109,11 @@ namespace StardewModdingAPI.Tests
Assert.AreEqual(original["ExtraString"], mod.Manifest.ExtraFields["ExtraString"], "The manifest's extra fields should contain an 'ExtraString' value.");
Assert.AreEqual(original["ExtraInt"], mod.Manifest.ExtraFields["ExtraInt"], "The manifest's extra fields should contain an 'ExtraInt' value.");
+#if EXPERIMENTAL
Assert.IsNotNull(mod.Manifest.Dependencies, "The dependencies field should not be null.");
Assert.AreEqual(1, mod.Manifest.Dependencies.Length, "The dependencies field should contain one value.");
Assert.AreEqual(originalDependency[nameof(IManifestDependency.UniqueID)], mod.Manifest.Dependencies[0].UniqueID, "The first dependency's unique ID doesn't match.");
+#endif
}
/****
@@ -211,6 +215,7 @@ namespace StardewModdingAPI.Tests
// if Moq doesn't throw a method-not-setup exception, the validation didn't override the status.
}
+#if EXPERIMENTAL
/****
** ProcessDependencies
****/
@@ -339,6 +344,7 @@ namespace StardewModdingAPI.Tests
modD.Verify(p => p.SetStatus(ModMetadataStatus.Failed, It.IsAny<string>()), Times.Once, "Mod D was expected to fail since it's part of a dependency loop.");
modE.Verify(p => p.SetStatus(ModMetadataStatus.Failed, It.IsAny<string>()), Times.Once, "Mod E was expected to fail since it's part of a dependency loop.");
}
+#endif
/*********
@@ -361,6 +367,7 @@ namespace StardewModdingAPI.Tests
return manifest;
}
+#if EXPERIMENTAL
/// <summary>Get a randomised basic manifest.</summary>
/// <param name="uniqueID">The mod's name and unique ID.</param>
/// <param name="dependencies">The dependencies this mod requires.</param>
@@ -387,5 +394,6 @@ namespace StardewModdingAPI.Tests
}
return mod;
}
+#endif
}
}