Exemple #1
0
        public DummyModelsControllerV2Tests(CustomWebApplicationFactory <DummyModelsControllerV2Tests> factory)
        {
            var scope = factory.Server.Services.CreateScope();

            this._context           = scope.ServiceProvider.GetRequiredService <ApplicationDbContext>();
            this._dummyModelBuilder = new DummyModelBuilder(this._context);

            this._client = factory.CreateClient(new WebApplicationFactoryClientOptions
            {
                AllowAutoRedirect = false,
            });
        }
Exemple #2
0
        public DummyModelsControllerV1Tests(CustomWebApplicationFactory <DummyModelsControllerV1Tests> factory)
        {
            var scope = factory.Server.Services.CreateScope();

            this._context           = scope.ServiceProvider.GetRequiredService <ApplicationDbContext>();
            this._dummyModelBuilder = new DummyModelBuilder(this._context);
            this._accountsService   = scope.ServiceProvider.GetRequiredService <IAccountsService>();

            var userManager     = scope.ServiceProvider.GetRequiredService <UserManager <ApplicationUser> >();
            var identityContext = scope.ServiceProvider.GetRequiredService <IdentityContext>();

            this._userBuilder = new UserBuilder(userManager, identityContext);

            this._client = factory.CreateClient(new WebApplicationFactoryClientOptions
            {
                AllowAutoRedirect = false,
            });
        }