-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert HasKey binary breaking change and add a test for IdentityServer4
- Loading branch information
1 parent
a8bc2b6
commit 7a30fe7
Showing
5 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
test/EFCore.SqlServer.FunctionalTests/IdentityServerTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using IdentityServer4.EntityFramework.DbContexts; | ||
using IdentityServer4.EntityFramework.Options; | ||
using Microsoft.EntityFrameworkCore.Diagnostics; | ||
using Microsoft.EntityFrameworkCore.TestUtilities; | ||
using Xunit; | ||
|
||
namespace Microsoft.EntityFrameworkCore | ||
{ | ||
public class IdentityServerTest | ||
{ | ||
[ConditionalFact] | ||
public void Can_initialize_PersistedGrantDbContext() | ||
{ | ||
using var testDatabase = SqlServerTestStore.CreateInitialized("IdentityServerPersistedGrantDbContext"); | ||
var options = CreateOptions(testDatabase); | ||
using (var context = new PersistedGrantDbContext(options, new OperationalStoreOptions())) | ||
{ | ||
context.Database.EnsureCreatedResiliently(); | ||
} | ||
} | ||
|
||
private DbContextOptions<PersistedGrantDbContext> CreateOptions(TestStore testStore) | ||
=> (DbContextOptions<PersistedGrantDbContext>)testStore | ||
.AddProviderOptions(new DbContextOptionsBuilder(new DbContextOptions<PersistedGrantDbContext>())) | ||
.EnableDetailedErrors() | ||
.EnableSensitiveDataLogging() | ||
.ConfigureWarnings( | ||
b => b.Default(WarningBehavior.Throw) | ||
.Log(CoreEventId.SensitiveDataLoggingEnabledWarning) | ||
.Log(CoreEventId.PossibleUnintendedReferenceComparisonWarning)) | ||
.Options; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters