Skip to content

Commit

Permalink
chore: Fix analyzer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Nov 20, 2023
1 parent ff5290a commit 84d4e0b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions tests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ dotnet_diagnostic.CA2007.severity = none # https://github.com/atc-net
dotnet_diagnostic.CA1819.severity = suggestion # CA1819: Properties should not return arrays
dotnet_diagnostic.CA1849.severity = suggestion # CA1849: Call async methods when in an async method
dotnet_diagnostic.xUnit1026.severity = none # xUnit1026: Theory methods should use all of their parameters
dotnet_diagnostic.xUnit1034.severity = none # xUnit1034: Null should not be used for type parameter
dotnet_diagnostic.S1144.severity = suggestion # S1144: Unused private types or members should be removed
dotnet_diagnostic.S2094.severity = suggestion # S2094: Classes should not be empty
dotnet_diagnostic.S6562.severity = suggestion # "Provide the "DateTimeKind" when creating this object.
10 changes: 5 additions & 5 deletions tests/bunit.web.tests/EventDispatchExtensions/KeyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public void GetWithValue(string value)
[Theory(DisplayName = "Get method with empty value parameter should throw exception")]
[InlineData(null)]
[InlineData("")]
public void GetWithNullValue(string value)
public void GetWithNullValue(string? value)
{
Should.Throw<ArgumentNullException>(() => Key.Get(value));
Should.Throw<ArgumentNullException>(() => Key.Get(value!));
}

[Theory(DisplayName = "Casting from string should return initialized Key object")]
Expand All @@ -62,7 +62,7 @@ public void CanCastFromString(string value)
[Theory(DisplayName = "Casting from null or empty string throws ArgumentNullException")]
[InlineData(null)]
[InlineData("")]
public void CastingFromNullStringThrowsException(string value)
public void CastingFromNullStringThrowsException(string? value)
{
Should.Throw<ArgumentNullException>(() => (Key)value);
}
Expand Down Expand Up @@ -102,9 +102,9 @@ public void GetWithValueAndCode(string value, string code)
[InlineData("", "t")]
[InlineData("T", null)]
[InlineData("T", "")]
public void GetWithNullValueAndNonNullCode(string value, string code)
public void GetWithNullValueAndNonNullCode(string? value, string? code)
{
Should.Throw<ArgumentNullException>(() => Key.Get(value, code));
Should.Throw<ArgumentNullException>(() => Key.Get(value!, code!));
}

[Theory(DisplayName = "Get with char value should return initialized Key object")]
Expand Down
6 changes: 3 additions & 3 deletions tests/bunit.web.tests/JSInterop/BunitJSObjectReferenceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class BunitJSObjectReferenceTest : TestContext
[InlineData("import", "file.js")]
[InlineData("customImport", null)]
[InlineData("customImport", "file.js")]
public void Test001(string identifier, object arg1)
public void Test001(string identifier, object? arg1)
{
Should.Throw<ArgumentException>(() => JSInterop.Setup<JSObjectReference>(identifier, arg1));
Should.Throw<ArgumentException>(() => JSInterop.Setup<IJSObjectReference>(identifier, arg1));
Expand All @@ -36,7 +36,7 @@ public void Test001(string identifier, object arg1)
[InlineData(null)]
[InlineData("")]
[InlineData(" ")]
public void Test002(string url)
public void Test002(string? url)
=> Should.Throw<ArgumentException>(() => JSInterop.SetupModule(url));

[Fact(DisplayName = "Calling SetupModule(jsInterop, identifier, invocationMatcher) with any null values throws")]
Expand Down Expand Up @@ -96,7 +96,7 @@ public async Task Test020()
[InlineData(null)]
[InlineData("")]
[InlineData("BAR.js")]
public void Test021(string requestedRoduleName)
public void Test021(string? requestedRoduleName)
{
JSInterop.SetupModule("FOO.js");

Expand Down

0 comments on commit 84d4e0b

Please sign in to comment.