0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-29 18:21:08 +00:00

feat: Add deleted entities to integration tests

This commit is contained in:
alex289 2024-12-08 22:56:06 +01:00
parent 8b9253c095
commit a03f1ce685
No known key found for this signature in database
GPG Key ID: 573F77CD2D87F863
2 changed files with 21 additions and 1 deletions

View File

@ -21,6 +21,13 @@ public sealed class TenantTestFixture : TestFixtureBase
CreatedTenantId,
"Test Tenant"));
// This tenant should not be included in any queries
var deletedTenant = new Tenant(
CreatedTenantId,
"Test Tenant2");
deletedTenant.Delete();
context.Tenants.Add(deletedTenant);
context.Users.Add(new User(
Guid.NewGuid(),
CreatedTenantId,

View File

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using CleanArchitecture.Domain.Constants;
using CleanArchitecture.Domain.Entities;
using CleanArchitecture.Domain.Enums;
@ -29,6 +30,18 @@ public sealed class UserTestFixture : TestFixtureBase
"$2a$12$Blal/uiFIJdYsCLTMUik/egLbfg3XhbnxBC6Sb5IKz2ZYhiU/MzL2",
UserRole.Admin));
// This user should not be included in any queries
var deletedUsed = new User(
Guid.NewGuid(),
Ids.Seed.TenantId,
"admin2@email.com",
"Admin2",
"User2",
"$2a$12$Blal/uiFIJdYsCLTMUik/egLbfg3XhbnxBC6Sb5IKz2ZYhiU/MzL2",
UserRole.User);
deletedUsed.Delete();
context.Users.Add(deletedUsed);
context.Users.Add(new User(
TestAuthenticationOptions.TestUserId,
Ids.Seed.TenantId,