summaryrefslogtreecommitdiff
path: root/src/SMAPI.Tests/Core/AssetNameTests.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-12 20:52:01 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-12 20:52:01 -0400
commit5f7a92a74592a53529890eebb1ee9fe519afd92f (patch)
tree67c515794b8dcc7d4721adc3b2f239edd68f9009 /src/SMAPI.Tests/Core/AssetNameTests.cs
parentc3851ae2e6c8fb286d4744612fbfea039d1baf7f (diff)
downloadSMAPI-5f7a92a74592a53529890eebb1ee9fe519afd92f.tar.gz
SMAPI-5f7a92a74592a53529890eebb1ee9fe519afd92f.tar.bz2
SMAPI-5f7a92a74592a53529890eebb1ee9fe519afd92f.zip
enable nullable annotations in unit tests (#837)
Diffstat (limited to 'src/SMAPI.Tests/Core/AssetNameTests.cs')
-rw-r--r--src/SMAPI.Tests/Core/AssetNameTests.cs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/SMAPI.Tests/Core/AssetNameTests.cs b/src/SMAPI.Tests/Core/AssetNameTests.cs
index ef8a08ef..8018442c 100644
--- a/src/SMAPI.Tests/Core/AssetNameTests.cs
+++ b/src/SMAPI.Tests/Core/AssetNameTests.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System;
using System.Collections.Generic;
using FluentAssertions;
@@ -28,7 +26,7 @@ namespace SMAPI.Tests.Core
[TestCase("Characters/Dialogue/Abigail.fr-FR", "Characters/Dialogue/Abigail", "fr-FR", LocalizedContentManager.LanguageCode.fr)]
[TestCase("Characters/Dialogue\\Abigail.fr-FR", "Characters/Dialogue/Abigail.fr-FR", null, null)]
[TestCase("Characters/Dialogue/Abigail.fr-FR", "Characters/Dialogue/Abigail", "fr-FR", LocalizedContentManager.LanguageCode.fr)]
- public void Constructor_Valid(string name, string expectedBaseName, string expectedLocale, LocalizedContentManager.LanguageCode? expectedLanguageCode)
+ public void Constructor_Valid(string name, string expectedBaseName, string? expectedLocale, LocalizedContentManager.LanguageCode? expectedLanguageCode)
{
// arrange
name = PathUtilities.NormalizeAssetName(name);
@@ -55,13 +53,13 @@ namespace SMAPI.Tests.Core
[TestCase(" ")]
[TestCase("\t")]
[TestCase(" \t ")]
- public void Constructor_NullOrWhitespace(string name)
+ public void Constructor_NullOrWhitespace(string? name)
{
// act
- ArgumentException exception = Assert.Throws<ArgumentException>(() => _ = AssetName.Parse(name, null));
+ ArgumentException exception = Assert.Throws<ArgumentException>(() => _ = AssetName.Parse(name!, null))!;
// assert
- exception!.ParamName.Should().Be("rawName");
+ exception.ParamName.Should().Be("rawName");
exception.Message.Should().Be("The asset name can't be null or empty. (Parameter 'rawName')");
}