Skip to content

Commit af03968

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

File tree

9 files changed

+63
-0
lines changed

9 files changed

+63
-0
lines changed

src/Security/Authentication/test/BearerTokenTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@ protected override void RegisterAuth(AuthenticationBuilder services, Action<Bear
2323
{
2424
services.AddBearerToken(configure);
2525
}
26+
27+
[Fact]
28+
public void EventsPropertyIsInitializedOnConstruction()
29+
{
30+
var options = new BearerTokenOptions();
31+
Assert.NotNull(options.Events);
32+
}
2633
}

src/Security/Authentication/test/CookieTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ protected override void RegisterAuth(AuthenticationBuilder services, Action<Cook
3232
services.AddCookie(configure);
3333
}
3434

35+
[Fact]
36+
public void EventsPropertyIsInitializedOnConstruction()
37+
{
38+
var options = new CookieAuthenticationOptions();
39+
Assert.NotNull(options.Events);
40+
}
41+
3542
[Fact]
3643
public async Task NormalRequestPassesThrough()
3744
{

src/Security/Authentication/test/FacebookTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ protected override void ConfigureDefaults(FacebookOptions o)
4242
o.SignInScheme = "auth1";
4343
}
4444

45+
[Fact]
46+
public void EventsPropertyIsInitializedOnConstruction()
47+
{
48+
var options = new FacebookOptions();
49+
Assert.NotNull(options.Events);
50+
}
51+
4552
[Fact]
4653
public async Task ThrowsIfAppIdMissing()
4754
{

src/Security/Authentication/test/GoogleTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ protected override void ConfigureDefaults(GoogleOptions o)
4242
o.SignInScheme = "auth1";
4343
}
4444

45+
[Fact]
46+
public void EventsPropertyIsInitializedOnConstruction()
47+
{
48+
var options = new GoogleOptions();
49+
Assert.NotNull(options.Events);
50+
}
51+
4552
[Fact]
4653
public async Task ChallengeWillTriggerRedirection()
4754
{

src/Security/Authentication/test/MicrosoftAccountTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ protected override void ConfigureDefaults(MicrosoftAccountOptions o)
4343
o.SignInScheme = "auth1";
4444
}
4545

46+
[Fact]
47+
public void EventsPropertyIsInitializedOnConstruction()
48+
{
49+
var options = new MicrosoftAccountOptions();
50+
Assert.NotNull(options.Events);
51+
}
52+
4653
[Fact]
4754
public async Task ChallengeWillTriggerApplyRedirectEvent()
4855
{

src/Security/Authentication/test/OAuthTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ protected override void RegisterAuth(AuthenticationBuilder services, Action<OAut
3131
});
3232
}
3333

34+
[Fact]
35+
public void EventsPropertyIsInitializedOnConstruction()
36+
{
37+
var options = new OAuthOptions();
38+
Assert.NotNull(options.Events);
39+
}
40+
3441
[Fact]
3542
public async Task ThrowsIfClientIdMissing()
3643
{

src/Security/Authentication/test/OpenIdConnect/OpenIdConnectTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ public class OpenIdConnectTests
2525
static readonly string nonceDelimiter = ".";
2626
const string DefaultHost = @"https://example.com";
2727

28+
[Fact]
29+
public void EventsPropertyIsInitializedOnConstruction()
30+
{
31+
var options = new OpenIdConnectOptions();
32+
Assert.NotNull(options.Events);
33+
}
34+
2835
/// <summary>
2936
/// Tests RedirectForSignOutContext replaces the OpenIdConnectMesssage correctly.
3037
/// </summary>

src/Security/Authentication/test/TwitterTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ protected override void ConfigureDefaults(TwitterOptions o)
4141
o.SignInScheme = "auth1";
4242
}
4343

44+
[Fact]
45+
public void EventsPropertyIsInitializedOnConstruction()
46+
{
47+
var options = new TwitterOptions();
48+
Assert.NotNull(options.Events);
49+
}
50+
4451
[Fact]
4552
public async Task ChallengeWillTriggerApplyRedirectEvent()
4653
{

src/Security/Authentication/test/WsFederation/WsFederationTest.cs

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

2424
public class WsFederationTest
2525
{
26+
[Fact]
27+
public void EventsPropertyIsInitializedOnConstruction()
28+
{
29+
var options = new WsFederationOptions();
30+
Assert.NotNull(options.Events);
31+
}
32+
2633
[Fact]
2734
public async Task VerifySchemeDefaults()
2835
{

0 commit comments

Comments
 (0)