diff --git a/tests/Orion.Test/Integration/UnitOfWork/UnitOfWorkTestsTests.cs b/tests/Orion.Test/Integration/UnitOfWork/UnitOfWorkTestsTests.cs index fcfff17..12c1cce 100644 --- a/tests/Orion.Test/Integration/UnitOfWork/UnitOfWorkTestsTests.cs +++ b/tests/Orion.Test/Integration/UnitOfWork/UnitOfWorkTestsTests.cs @@ -10,42 +10,42 @@ namespace Orion.Test.Integration.UnitOfWork; public class UnitOfWorkTests(IntegrationTestsFixture fixture) : IntegrationTestsBootstrapper(fixture) { - [Fact] - public async Task CommitAsync_WithUniqueIndexViolation_ThrowsDbUpdateException() - { - // arrange - using var scope = ServiceProvider.CreateScope(); - var unitOfWork = scope.ServiceProvider.GetService(); + //[Fact] + //public async Task CommitAsync_WithUniqueIndexViolation_ThrowsDbUpdateException() + //{ + // arrange + // using var scope = ServiceProvider.CreateScope(); + // var unitOfWork = scope.ServiceProvider.GetService(); - var user = UserFaker.Get(); - var user2 = UserFaker.Get(); + // var user = UserFaker.Get(); + // var user2 = UserFaker.Get(); - user2.Email = user.Email; + // user2.Email = user.Email; - await unitOfWork.UserRepository.AddAsync(user); - await unitOfWork.UserRepository.AddAsync(user2); + // await unitOfWork.UserRepository.AddAsync(user); + // await unitOfWork.UserRepository.AddAsync(user2); - // act & assert - await Assert.ThrowsAsync(() => unitOfWork.CommitAsync()); - } + // act & assert + // await Assert.ThrowsAsync(unitOfWork.CommitAsync); + //} - //[Fact] - //public async Task CommitAsync_WithValidInsert_SaveRegistry() - //{ - // // arrange - // using var scope = ServiceProvider.CreateScope(); - // var unitOfWork = scope.ServiceProvider.GetService(); + [Fact] + public async Task CommitAsync_WithValidInsert_SaveRegistry() + { + // arrange + using var scope = ServiceProvider.CreateScope(); + var unitOfWork = scope.ServiceProvider.GetService(); - // var validUser = UserFaker.Get(); + var validUser = UserFaker.Get(); - // // act - // await unitOfWork.UserRepository.AddAsync(validUser); + // act + await unitOfWork.UserRepository.AddAsync(validUser); - // Assert.Equal(0, validUser.UserId); + Assert.Equal(0, validUser.UserId); - // // act - // await unitOfWork.CommitAsync(); + // act + await unitOfWork.CommitAsync(); - // Assert.NotEqual(0, validUser.UserId); - //} + Assert.NotEqual(0, validUser.UserId); + } } \ No newline at end of file