tests: make sure SdnId is set for dependent entities

This commit is contained in:
Stevan Freeborn
2024-08-22 16:22:22 -05:00
parent 0aa58c5b1a
commit 6d4b58db02
5 changed files with 19 additions and 1 deletions
@@ -18,6 +18,7 @@ public class CommentRepositoryTests : RepositoryTest
_timeProvider.Setup(x => x.GetUtcNow()).Returns(now);
var entity = _faker.Generate();
entity.SdnId = SdnId;
await _repository.Upsert(entity);
await _context.SaveChangesAsync();
@@ -38,6 +39,7 @@ public class CommentRepositoryTests : RepositoryTest
_timeProvider.Setup(x => x.GetUtcNow()).Returns(createdTimeStamp);
var entity = _faker.Generate();
entity.SdnId = SdnId;
// Insert the entity
await _repository.Upsert(entity);
@@ -72,6 +74,7 @@ public class CommentRepositoryTests : RepositoryTest
foreach (var entity in entities)
{
entity.SdnId = SdnId;
await _repository.Upsert(entity);
}