diff --git a/DigitalData.Core.Tests/Infrastructure/DbRepositoryTests.cs b/DigitalData.Core.Tests/Infrastructure/DbRepositoryTests.cs index e63ded3..f9c321f 100644 --- a/DigitalData.Core.Tests/Infrastructure/DbRepositoryTests.cs +++ b/DigitalData.Core.Tests/Infrastructure/DbRepositoryTests.cs @@ -1,12 +1,13 @@ namespace DigitalData.Core.Tests.Infrastructure; -using Bogus; using DigitalData.Core.Infrastructure; using DigitalData.Core.Tests.Mock; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System.Reflection; +using DigitalData.Core.Tests.Mock; +using DigitalData.Core.Abstractions.Infrastructure; public class DbRepositoryTests { @@ -32,4 +33,16 @@ public class DbRepositoryTests if (_host is IDisposable disposableHost) disposableHost.Dispose(); } + + [Test] + public void CreateAsync_ShouldPersistUser() + { + // Arrange + var faker = Fake.CreateUserFaker(); + var user = faker.Generate(); + var repo = _host.Services.GetRequiredService>(); + + // Act & Assert + Assert.DoesNotThrowAsync(async () => await repo.CreateAsync(user)); + } }