summaryrefslogtreecommitdiff
path: root/src/SMAPI.Tests/Utilities
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-13 21:07:43 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-13 21:07:43 -0400
commit4adf8611131a5d86b15f017a42a0366837d14528 (patch)
tree879ba8dfc546382c3795e3d13a623b0e17f96469 /src/SMAPI.Tests/Utilities
parent5b24fff4771dd11c627ae20c827599fe37fa89ad (diff)
downloadSMAPI-4adf8611131a5d86b15f017a42a0366837d14528.tar.gz
SMAPI-4adf8611131a5d86b15f017a42a0366837d14528.tar.bz2
SMAPI-4adf8611131a5d86b15f017a42a0366837d14528.zip
enable nullable annotations in the rest of SMAPI core (#837)
Diffstat (limited to 'src/SMAPI.Tests/Utilities')
-rw-r--r--src/SMAPI.Tests/Utilities/KeybindListTests.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/SMAPI.Tests/Utilities/KeybindListTests.cs b/src/SMAPI.Tests/Utilities/KeybindListTests.cs
index 060c93ed..c4c086de 100644
--- a/src/SMAPI.Tests/Utilities/KeybindListTests.cs
+++ b/src/SMAPI.Tests/Utilities/KeybindListTests.cs
@@ -21,12 +21,12 @@ namespace SMAPI.Tests.Utilities
public void TryParse_SimpleValue(SButton button)
{
// act
- bool success = KeybindList.TryParse($"{button}", out KeybindList parsed, out string[] errors);
+ bool success = KeybindList.TryParse($"{button}", out KeybindList? parsed, out string[] errors);
// assert
Assert.IsTrue(success, "Parsing unexpectedly failed.");
Assert.IsNotNull(parsed, "The parsed result should not be null.");
- Assert.AreEqual(parsed.ToString(), $"{button}");
+ Assert.AreEqual(parsed!.ToString(), $"{button}");
Assert.IsNotNull(errors, message: "The errors should never be null.");
Assert.IsEmpty(errors, message: "The input bindings incorrectly reported errors.");
}
@@ -47,14 +47,14 @@ namespace SMAPI.Tests.Utilities
public string TryParse_MultiValues(string? input)
{
// act
- bool success = KeybindList.TryParse(input, out KeybindList parsed, out string[] errors);
+ bool success = KeybindList.TryParse(input, out KeybindList? parsed, out string[] errors);
// assert
Assert.IsTrue(success, "Parsing unexpectedly failed.");
Assert.IsNotNull(parsed, "The parsed result should not be null.");
Assert.IsNotNull(errors, message: "The errors should never be null.");
Assert.IsEmpty(errors, message: "The input bindings incorrectly reported errors.");
- return parsed.ToString();
+ return parsed!.ToString();
}
/// <summary>Assert invalid values are rejected.</summary>
@@ -67,7 +67,7 @@ namespace SMAPI.Tests.Utilities
public void TryParse_InvalidValues(string input, string expectedError)
{
// act
- bool success = KeybindList.TryParse(input, out KeybindList parsed, out string[] errors);
+ bool success = KeybindList.TryParse(input, out KeybindList? parsed, out string[] errors);
// assert
Assert.IsFalse(success, "Parsing unexpectedly succeeded.");