summaryrefslogtreecommitdiff
path: root/src/SMAPI.Tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Tests')
-rw-r--r--src/SMAPI.Tests/Utilities/KeybindListTests.cs6
-rw-r--r--src/SMAPI.Tests/Utilities/SemanticVersionTests.cs4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/SMAPI.Tests/Utilities/KeybindListTests.cs b/src/SMAPI.Tests/Utilities/KeybindListTests.cs
index c4c086de..c5fd5daf 100644
--- a/src/SMAPI.Tests/Utilities/KeybindListTests.cs
+++ b/src/SMAPI.Tests/Utilities/KeybindListTests.cs
@@ -136,11 +136,11 @@ namespace SMAPI.Tests.Utilities
foreach (string rawPair in stateMap.Split(','))
{
// parse values
- string[] parts = rawPair.Split(new[] { ':' }, 2);
+ string[] parts = rawPair.Split(':', 2, StringSplitOptions.TrimEntries);
if (!Enum.TryParse(parts[0], ignoreCase: true, out SButton curButton))
- Assert.Fail($"The state map is invalid: unknown button value '{parts[0].Trim()}'");
+ Assert.Fail($"The state map is invalid: unknown button value '{parts[0]}'");
if (!Enum.TryParse(parts[1], ignoreCase: true, out SButtonState state))
- Assert.Fail($"The state map is invalid: unknown state value '{parts[1].Trim()}'");
+ Assert.Fail($"The state map is invalid: unknown state value '{parts[1]}'");
// get state
if (curButton == button)
diff --git a/src/SMAPI.Tests/Utilities/SemanticVersionTests.cs b/src/SMAPI.Tests/Utilities/SemanticVersionTests.cs
index fedadba6..77c0da5f 100644
--- a/src/SMAPI.Tests/Utilities/SemanticVersionTests.cs
+++ b/src/SMAPI.Tests/Utilities/SemanticVersionTests.cs
@@ -382,11 +382,11 @@ namespace SMAPI.Tests.Utilities
{
// act
string json = JsonConvert.SerializeObject(new SemanticVersion(versionStr));
- SemanticVersion after = JsonConvert.DeserializeObject<SemanticVersion>(json);
+ SemanticVersion? after = JsonConvert.DeserializeObject<SemanticVersion>(json);
// assert
Assert.IsNotNull(after, "The semantic version after deserialization is unexpectedly null.");
- Assert.AreEqual(versionStr, after.ToString(), "The semantic version after deserialization doesn't match the input version.");
+ Assert.AreEqual(versionStr, after!.ToString(), "The semantic version after deserialization doesn't match the input version.");
}