aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/IntegratedTests/TokenTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline.Tests/IntegratedTests/TokenTest.cs')
-rw-r--r--Timeline.Tests/IntegratedTests/TokenTest.cs11
1 files changed, 2 insertions, 9 deletions
diff --git a/Timeline.Tests/IntegratedTests/TokenTest.cs b/Timeline.Tests/IntegratedTests/TokenTest.cs
index 7b28746f..d1c31606 100644
--- a/Timeline.Tests/IntegratedTests/TokenTest.cs
+++ b/Timeline.Tests/IntegratedTests/TokenTest.cs
@@ -1,5 +1,4 @@
using FluentAssertions;
-using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using System.Net.Http;
@@ -17,12 +16,6 @@ namespace Timeline.Tests.IntegratedTests
private const string CreateTokenUrl = "token/create";
private const string VerifyTokenUrl = "token/verify";
- public TokenTest(WebApplicationFactory<Startup> factory)
- : base(factory)
- {
-
- }
-
private static async Task<CreateTokenResponse> CreateUserTokenAsync(HttpClient client, string username, string password, int? expireOffset = null)
{
var response = await client.PostAsJsonAsync(CreateTokenUrl, new CreateTokenRequest { Username = username, Password = password, Expire = expireOffset });
@@ -106,7 +99,7 @@ namespace Timeline.Tests.IntegratedTests
using var client = await CreateDefaultClient();
var token = (await CreateUserTokenAsync(client, "user1", "user1pw")).Token;
- using (var scope = Factory.Services.CreateScope()) // UserService is scoped.
+ using (var scope = TestApp.Host.Services.CreateScope()) // UserService is scoped.
{
// create a user for test
var userService = scope.ServiceProvider.GetRequiredService<IUserService>();
@@ -126,7 +119,7 @@ namespace Timeline.Tests.IntegratedTests
using var client = await CreateDefaultClient();
var token = (await CreateUserTokenAsync(client, "user1", "user1pw")).Token;
- using (var scope = Factory.Server.Host.Services.CreateScope()) // UserService is scoped.
+ using (var scope = TestApp.Host.Services.CreateScope()) // UserService is scoped.
{
var userService = scope.ServiceProvider.GetRequiredService<IUserService>();
await userService.DeleteUser("user1");