24 lines
736 B
C#
24 lines
736 B
C#
|
|
using IdentityShroud.Core.Services;
|
||
|
|
using Microsoft.AspNetCore.Hosting;
|
||
|
|
using Microsoft.AspNetCore.Mvc.Testing;
|
||
|
|
using Microsoft.Extensions.DependencyInjection;
|
||
|
|
using Microsoft.VisualStudio.TestPlatform.TestHost;
|
||
|
|
|
||
|
|
namespace IdentityShroud.Core.Tests.Fixtures;
|
||
|
|
|
||
|
|
public class ApplicationFactory : WebApplicationFactory<Program>
|
||
|
|
{
|
||
|
|
public IRealmService RealmService { get; } = Substitute.For<IRealmService>();
|
||
|
|
|
||
|
|
protected override void ConfigureWebHost(IWebHostBuilder builder)
|
||
|
|
{
|
||
|
|
base.ConfigureWebHost(builder);
|
||
|
|
|
||
|
|
builder.ConfigureServices(services =>
|
||
|
|
{
|
||
|
|
services.AddScoped<IRealmService>(c => RealmService);
|
||
|
|
});
|
||
|
|
|
||
|
|
builder.UseEnvironment("Development");
|
||
|
|
}
|
||
|
|
}
|