Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(xUnit1012): address static code analysis #190

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/IbanNet.Tests/IbanParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public Integration()
[InlineData("", typeof(IbanFormatException))]
[InlineData("AD12000120359100100", typeof(IbanFormatException))]
[InlineData("Invalid", typeof(IbanFormatException))]
public void Given_invalid_value_when_parsing_it_should_throw(string attemptedIbanValue, Type expectedExceptionType)
public void Given_invalid_value_when_parsing_it_should_throw(string? attemptedIbanValue, Type expectedExceptionType)
{
// Act
Action act = () => _sut.Parse(attemptedIbanValue);
Action act = () => _sut.Parse(attemptedIbanValue!);

// Assert
act.Should()
Expand All @@ -46,7 +46,7 @@ public void Given_invalid_value_when_parsing_it_should_throw(string attemptedIba
[InlineData("")]
[InlineData("AD12000120359100100")]
[InlineData("Invalid")]
public void Given_invalid_value_when_trying_parsing_it_should_not_throw_and_return_false(string attemptedIbanValue)
public void Given_invalid_value_when_trying_parsing_it_should_not_throw_and_return_false(string? attemptedIbanValue)
{
// Act
Func<bool> act = () => _sut.TryParse(attemptedIbanValue, out _);
Expand Down
2 changes: 1 addition & 1 deletion test/IbanNet.Tests/IbanTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public void Given_an_iban_when_serializing_it_should_return_expected_json(string
[InlineData(null, "null")] // JSON null.
[InlineData(null, "\"\"")] // Empty string
[InlineData(null, "\" \"")] // String with whitespace
public void Given_a_valid_jsonString_when_deserializing_it_should_return_expected_iban(string expectedIban, string json)
public void Given_a_valid_jsonString_when_deserializing_it_should_return_expected_iban(string? expectedIban, string json)
{
// Act
Iban? iban = System.Text.Json.JsonSerializer.Deserialize<Iban>(json);
Expand Down
2 changes: 1 addition & 1 deletion test/IbanNet.Tests/IbanValidatorIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void When_validating_iban_that_allows_lowercase_it_should_validate()
[Theory]
[InlineData(null)]
[InlineData("")]
public void When_validating_null_or_empty_value_should_not_validate(string iban)
public void When_validating_null_or_empty_value_should_not_validate(string? iban)
{
// Act
ValidationResult actual = _sut.Validate(iban);
Expand Down
2 changes: 1 addition & 1 deletion test/IbanNet.Tests/Internal/InputNormalizationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class InputNormalizationTests
[InlineData("UNCHANGED", "UNCHANGED")]
[InlineData("", "")]
[InlineData(null, null)]
public void Given_string_when_normalizing_it_should_return_expected_value(string input, string expected)
public void Given_string_when_normalizing_it_should_return_expected_value(string? input, string? expected)
{
// Act
string? actual = InputNormalization.NormalizeOrNull(input);
Expand Down
5 changes: 2 additions & 3 deletions test/IbanNet.Tests/Registry/IbanCountryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ public class IbanCountryTests
[InlineData("")]
[InlineData("N")]
[InlineData("NLD")]
public void When_country_code_is_of_invalid_length_should_throw(string twoLetterISORegionName)
public void When_country_code_is_of_invalid_length_should_throw(string? twoLetterISORegionName)
{
// Act
// ReSharper disable once ObjectCreationAsStatement
Func<IbanCountry> act = () => new IbanCountry(twoLetterISORegionName);
Func<IbanCountry> act = () => new IbanCountry(twoLetterISORegionName!);

// Assert
act.Should()
Expand Down
Loading