Skip to content

Commit

Permalink
Updated tests to allow null assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-v committed May 29, 2024
1 parent e5490cd commit ffd1ebf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/CorsPolicyConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void TestAllowedOrigins()
Assert.IsTrue(config.AllowedOrigins.Count == 0);

// Try assigning null
config.AllowedOrigins = null;
config.AllowedOrigins = null!;
Assert.IsNotNull(config.AllowedOrigins);
Assert.IsTrue(config.AllowedOrigins.Count == 0);

Expand All @@ -45,7 +45,7 @@ public void TestAllowedHeaders()
Assert.IsTrue(config.AllowedHeaders.Count == 0);

// Try assigning null
config.AllowedHeaders = null;
config.AllowedHeaders = null!;
Assert.IsNotNull(config.AllowedHeaders);
Assert.IsTrue(config.AllowedHeaders.Count == 0);

Expand All @@ -65,7 +65,7 @@ public void TestAllowedMethods()
Assert.IsTrue(config.AllowedMethods.Count == 0);

// Try assigning null
config.AllowedMethods = null;
config.AllowedMethods = null!;
Assert.IsNotNull(config.AllowedMethods);
Assert.IsTrue(config.AllowedMethods.Count == 0);

Expand Down
2 changes: 1 addition & 1 deletion tests/PolicyManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void TestConstructor2()
[ExpectedException(typeof(ArgumentException))]
public void TestConstructor3()
{
PolicyManager policyManager = new(this._configuration, null);
PolicyManager policyManager = new(this._configuration, null!);
}

[TestMethod]
Expand Down

0 comments on commit ffd1ebf

Please sign in to comment.