You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.2 KiB
34 lines
1.2 KiB
/*
|
|
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
|
|
* See https://github.com/openiddict/openiddict-core for more information concerning
|
|
* the license and the contributors participating to this project.
|
|
*/
|
|
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Xunit;
|
|
|
|
namespace OpenIddict.EntityFrameworkCore.Tests
|
|
{
|
|
public class OpenIddictExtensionsTests
|
|
{
|
|
[Theory]
|
|
[InlineData(typeof(OpenIddictApplicationStoreResolver<DbContext>))]
|
|
[InlineData(typeof(OpenIddictAuthorizationStoreResolver<DbContext>))]
|
|
[InlineData(typeof(OpenIddictScopeStoreResolver<DbContext>))]
|
|
[InlineData(typeof(OpenIddictTokenStoreResolver<DbContext>))]
|
|
public void AddEntityFrameworkCoreStores_RegistersEntityFrameworkCoreStoreFactories(Type type)
|
|
{
|
|
// Arrange
|
|
var services = new ServiceCollection();
|
|
var builder = services.AddOpenIddict().AddCore();
|
|
|
|
// Act
|
|
builder.AddEntityFrameworkCoreStores<DbContext>();
|
|
|
|
// Assert
|
|
Assert.Contains(services, service => service.ImplementationType == type);
|
|
}
|
|
}
|
|
}
|
|
|