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:
parent
8b9253c095
commit
a03f1ce685
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user