mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 16:11:10 +00:00
Returns the unit of work save changes result
This commit is contained in:
1 parent
f3e465255e
commit
64ef3a1e22
141 files changed
+1388
-1151
No files matched your search
@@ -8,6 +8,7 @@ using Lumina.Application.Common.Infrastructure.Time;
|
||||
using Lumina.DataAccess.Common.DependencyInjection;
|
||||
using Lumina.DataAccess.Core.UoW;
|
||||
using Lumina.DataAccess.UnitTests.Common.Setup;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NSubstitute;
|
||||
@@ -96,9 +97,11 @@ public class UnitOfWorkTests
|
||||
CancellationToken cancellationToken = new();
|
||||
|
||||
// Act
|
||||
await unitOfWork.SaveChangesAsync(cancellationToken);
|
||||
Result<Success> result = await unitOfWork.SaveChangesAsync(cancellationToken);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsSuccess);
|
||||
Assert.Equal(Result.Success, result.Value);
|
||||
await dbContext.Received(1).SaveChangesAsync(cancellationToken);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user