mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-30 02:31:08 +00:00
chore: Cleanup
This commit is contained in:
parent
ca0489c3a1
commit
a4ead4955d
@ -35,12 +35,12 @@ public sealed class LoginUserCommandHandlerTests
|
||||
|
||||
Guid.Parse(userIdClaim!.Value).Should().Be(user.Id);
|
||||
|
||||
var userEmailClaim = decodedToken!.Claims
|
||||
var userEmailClaim = decodedToken.Claims
|
||||
.FirstOrDefault(x => string.Equals(x.Type, ClaimTypes.Email));
|
||||
|
||||
userEmailClaim!.Value.Should().Be(user.Email);
|
||||
|
||||
var userRoleClaim = decodedToken!.Claims
|
||||
var userRoleClaim = decodedToken.Claims
|
||||
.FirstOrDefault(x => string.Equals(x.Type, ClaimTypes.Role));
|
||||
|
||||
userRoleClaim!.Value.Should().Be(user.Role.ToString());
|
||||
|
@ -11,7 +11,7 @@ public sealed class ApiUser : IUser
|
||||
{
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
private string? _name = null;
|
||||
private string? _name;
|
||||
private Guid _userId = Guid.Empty;
|
||||
|
||||
public ApiUser(IHttpContextAccessor httpContextAccessor)
|
||||
|
@ -28,7 +28,7 @@ public sealed class InMemoryBusTests
|
||||
|
||||
await inMemoryBus.RaiseEventAsync(domainEvent);
|
||||
|
||||
await mediator.Received(1).Publish(Arg.Is<DomainNotification>(x => x.Equals(domainEvent)), default);
|
||||
await mediator.Received(1).Publish(Arg.Is<DomainNotification>(x => x.Equals(domainEvent)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -43,7 +43,7 @@ public sealed class InMemoryBusTests
|
||||
|
||||
await inMemoryBus.RaiseEventAsync(userDeletedEvent);
|
||||
|
||||
await mediator.Received(1).Publish(Arg.Is<UserDeletedEvent>(x => x.Equals(userDeletedEvent)), default);
|
||||
await mediator.Received(1).Publish(Arg.Is<UserDeletedEvent>(x => x.Equals(userDeletedEvent)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -58,6 +58,6 @@ public sealed class InMemoryBusTests
|
||||
|
||||
await inMemoryBus.SendCommandAsync(deleteUserCommand);
|
||||
|
||||
await mediator.Received(1).Send(Arg.Is<DeleteUserCommand>(x => x.Equals(deleteUserCommand)), default);
|
||||
await mediator.Received(1).Send(Arg.Is<DeleteUserCommand>(x => x.Equals(deleteUserCommand)));
|
||||
}
|
||||
}
|
@ -38,7 +38,7 @@ public sealed class UnitOfWorkTests
|
||||
|
||||
dbContextMock
|
||||
.When(x => x.SaveChangesAsync(CancellationToken.None))
|
||||
.Do(x => throw new DbUpdateException("Boom", new Exception("it broke")));
|
||||
.Do(_ => throw new DbUpdateException("Boom", new Exception("it broke")));
|
||||
|
||||
var unitOfWork = UnitOfWorkTestFixture.GetUnitOfWork(dbContextMock, loggerMock);
|
||||
|
||||
@ -56,7 +56,7 @@ public sealed class UnitOfWorkTests
|
||||
|
||||
dbContextMock
|
||||
.When(x => x.SaveChangesAsync(CancellationToken.None))
|
||||
.Do(x => throw new Exception("Boom"));
|
||||
.Do(_ => throw new Exception("Boom"));
|
||||
|
||||
var unitOfWork = UnitOfWorkTestFixture.GetUnitOfWork(dbContextMock, loggerMock);
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using CleanArchitecture.Infrastructure.Database;
|
||||
using CleanArchitecture.IntegrationTests.Infrastructure;
|
||||
|
Loading…
Reference in New Issue
Block a user