You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assert.AreEqual(original[nameof(IManifest.MinimumApiVersion)],mod.Manifest.MinimumApiVersion?.ToString(),"The manifest's minimum API version doesn't match.");
115
-
Assert.AreEqual(original[nameof(IManifest.Version)]?.ToString(),mod.Manifest.Version?.ToString(),"The manifest's version doesn't match.");
116
+
Assert.AreEqual(original[nameof(IManifest.MinimumGameVersion)],mod.Manifest.MinimumGameVersion?.ToString(),"The manifest's minimum game version doesn't match.");
117
+
Assert.AreEqual(original[nameof(IManifest.Version)].ToString(),mod.Manifest.Version.ToString(),"The manifest's version doesn't match.");
116
118
117
119
Assert.IsNotNull(mod.Manifest.ExtraFields,"The extra fields should not be null.");
118
120
Assert.AreEqual(2,mod.Manifest.ExtraFields.Count,"The extra fields should contain two values.");
@@ -133,7 +135,7 @@ public void ReadBasicManifest_CanReadFile()
133
135
[Test(Description="Assert that validation doesn't fail if there are no mods installed.")]
mock.Verify(p =>p.SetStatus(ModMetadataStatus.Failed,It.IsAny<ModFailReason>(),It.IsAny<string>(),It.IsAny<string>()),Times.Once,"The validation did not fail the metadata.");
@@ -175,7 +177,21 @@ public void ValidateManifests_MinimumApiVersion_Fails()
mock.Verify(p =>p.SetStatus(ModMetadataStatus.Failed,It.IsAny<ModFailReason>(),It.IsAny<string>(),It.IsAny<string>()),Times.Once,"The validation did not fail the metadata.");
184
+
}
185
+
186
+
[Test(Description="Assert that validation fails when the minimum game version is higher than the current Stardew Valley version.")]
mock.Verify(p =>p.SetStatus(ModMetadataStatus.Failed,It.IsAny<ModFailReason>(),It.IsAny<string>(),It.IsAny<string>()),Times.Once,"The validation did not fail the metadata.");
@@ -190,7 +206,7 @@ public void ValidateManifests_MissingEntryDLL_Fails()
mock.Verify(p =>p.SetStatus(ModMetadataStatus.Failed,It.IsAny<ModFailReason>(),It.IsAny<string>(),It.IsAny<string>()),Times.Once,"The validation did not fail the metadata.");
@@ -207,7 +223,7 @@ public void ValidateManifests_DuplicateUniqueID_Fails()
modA.Verify(p =>p.SetStatus(ModMetadataStatus.Failed,ModFailReason.Duplicate,It.IsAny<string>(),It.IsAny<string>()),Times.AtLeastOnce,"The validation did not fail the first mod with a unique ID.");
@@ -233,7 +249,7 @@ public void ValidateManifests_Valid_Passes()
/// <param name="description">A brief description of the mod.</param>
85
89
/// <param name="version">The mod version.</param>
86
90
/// <param name="minimumApiVersion">The minimum SMAPI version required by this mod, if any.</param>
91
+
/// <param name="minimumGameVersion">The minimum Stardew Valley version required by this mod, if any.</param>
87
92
/// <param name="entryDll">The name of the DLL in the directory that has the <c>Entry</c> method. Mutually exclusive with <see cref="ContentPackFor"/>.</param>
88
93
/// <param name="contentPackFor">The modID which will read this as a content pack.</param>
89
94
/// <param name="dependencies">The other mods that must be loaded before this mod.</param>
90
95
/// <param name="updateKeys">The namespaced mod IDs to query for updates (like <c>Nexus:541</c>).</param>
/// <param name="mods">The mod manifests to validate.</param>
68
68
/// <param name="apiVersion">The current SMAPI version.</param>
69
+
/// <param name="gameVersion">The current Stardew Valley version.</param>
69
70
/// <param name="getUpdateUrl">Get an update URL for an update key (if valid).</param>
70
71
/// <param name="getFileLookup">Get a file lookup for the given directory.</param>
71
72
/// <param name="validateFilesExist">Whether to validate that files referenced in the manifest (like <see cref="IManifest.EntryDll"/>) exist on disk. This can be disabled to only validate the manifest itself.</param>
72
73
[SuppressMessage("ReSharper","ConditionalAccessQualifierIsNonNullableAccordingToAPIContract",Justification="Manifest values may be null before they're validated.")]
73
74
[SuppressMessage("ReSharper","ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract",Justification="Manifest values may be null before they're validated.")]
mod.SetStatus(ModMetadataStatus.Failed,ModFailReason.Incompatible,$"it needs Stardew Valley {mod.Manifest.MinimumGameVersion} or later. Please update your game to the latest version to use this mod.");
0 commit comments