Skip to content

Commit 1e37ff1

Browse files
committed
Add tests for fixed types to verify Events is non-null
1 parent ac4df6f commit 1e37ff1

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

src/Security/Authentication/Negotiate/test/Negotiate.Test/NegotiateHandlerTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ namespace Microsoft.AspNetCore.Authentication.Negotiate;
2020

2121
public class NegotiateHandlerTests
2222
{
23+
[Fact]
24+
public void EventsPropertyIsInitializedOnConstruction()
25+
{
26+
var options = new NegotiateOptions();
27+
Assert.NotNull(options.Events);
28+
}
29+
2330
[Fact]
2431
public async Task Anonymous_MissingConnectionFeatures_ThrowsNotSupported()
2532
{

src/Security/Authentication/test/CertificateTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ namespace Microsoft.AspNetCore.Authentication.Certificate.Test;
2222

2323
public class ClientCertificateAuthenticationTests
2424
{
25+
[Fact]
26+
public void EventsPropertyIsInitializedOnConstruction()
27+
{
28+
var options = new CertificateAuthenticationOptions();
29+
Assert.NotNull(options.Events);
30+
}
2531

2632
[Fact]
2733
public async Task VerifySchemeDefaults()

src/Security/Authentication/test/JwtBearerTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ public class JwtBearerTests : SharedAuthenticationTests<JwtBearerOptions>
3333

3434
protected override void RegisterAuth(AuthenticationBuilder services, Action<JwtBearerOptions> configure)
3535
{
36-
services.AddJwtBearer(o =>
37-
{
38-
ConfigureDefaults(o);
39-
configure.Invoke(o);
40-
});
36+
services.AddJwtBearer(configure);
4137
}
4238

43-
private void ConfigureDefaults(JwtBearerOptions o)
39+
[Fact]
40+
public void EventsPropertyIsInitializedOnConstruction()
4441
{
42+
var options = new JwtBearerOptions();
43+
Assert.NotNull(options.Events);
4544
}
4645

4746
[Fact]

0 commit comments

Comments
 (0)