We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e86aeaa commit a9b8c74Copy full SHA for a9b8c74
1 file changed
API.IntegrationTests/AccountTests.cs
@@ -1,6 +1,9 @@
1
using System.Net;
2
using System.Text;
3
using System.Text.Json;
4
+using Microsoft.EntityFrameworkCore;
5
+using Microsoft.Extensions.DependencyInjection;
6
+using OpenShock.Common.OpenShockDb;
7
8
namespace OpenShock.API.IntegrationTests;
9
@@ -25,5 +28,12 @@ public async Task CreateAccount_ShouldAdd_NewUserToDatabase()
25
28
var content = await response.Content.ReadAsStringAsync();
26
29
27
30
await Assert.That(response.StatusCode).IsEqualTo(HttpStatusCode.OK);
31
+
32
+ await using var scope = WebAppFactory.Services.CreateAsyncScope();
33
+ var db = scope.ServiceProvider.GetRequiredService<OpenShockContext>();
34
35
+ var user = await db.Users.FirstOrDefaultAsync(u => u.Email == "bob@example.com");
36
37
+ await Assert.That(user is not null).IsTrue();
38
}
39
0 commit comments