Refactor code formatting and improve readability: standardize line breaks and indentation across various endpoint files, enhancing code clarity and maintainability. Update package version formatting in Directory.Packages.props for consistency.
This commit is contained in:
+7
-2
@@ -20,9 +20,14 @@ public class ChangeUserRoleCommandHandlerTests
|
||||
.Returns(Result.Success());
|
||||
|
||||
var handler = new ChangeUserRoleCommandHandler(_roleService);
|
||||
var result = await handler.Handle(new ChangeUserRoleCommand(userId, roleId), CancellationToken.None);
|
||||
var result = await handler.Handle(
|
||||
new ChangeUserRoleCommand(userId, roleId),
|
||||
CancellationToken.None
|
||||
);
|
||||
|
||||
Assert.True(result.IsSuccess);
|
||||
await _roleService.Received(1).ChangeUserRoleAsync(userId, roleId, Arg.Any<CancellationToken>());
|
||||
await _roleService
|
||||
.Received(1)
|
||||
.ChangeUserRoleAsync(userId, roleId, Arg.Any<CancellationToken>());
|
||||
}
|
||||
}
|
||||
|
||||
+7
-3
@@ -20,11 +20,14 @@ public class BlockUserCommandHandlerTests
|
||||
var userId = Guid.NewGuid();
|
||||
_currentUser.UserId.Returns(userId);
|
||||
|
||||
var result = await CreateHandler().Handle(new BlockUserCommand(userId), CancellationToken.None);
|
||||
var result = await CreateHandler()
|
||||
.Handle(new BlockUserCommand(userId), CancellationToken.None);
|
||||
|
||||
Assert.False(result.IsSuccess);
|
||||
Assert.Equal(UserErrors.CannotBlockSelf, result.Error);
|
||||
await _identityService.DidNotReceive().BlockUserAsync(Arg.Any<Guid>(), Arg.Any<CancellationToken>());
|
||||
await _identityService
|
||||
.DidNotReceive()
|
||||
.BlockUserAsync(Arg.Any<Guid>(), Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -37,7 +40,8 @@ public class BlockUserCommandHandlerTests
|
||||
.BlockUserAsync(targetId, Arg.Any<CancellationToken>())
|
||||
.Returns(Result.Success());
|
||||
|
||||
var result = await CreateHandler().Handle(new BlockUserCommand(targetId), CancellationToken.None);
|
||||
var result = await CreateHandler()
|
||||
.Handle(new BlockUserCommand(targetId), CancellationToken.None);
|
||||
|
||||
Assert.True(result.IsSuccess);
|
||||
await _identityService.Received(1).BlockUserAsync(targetId, Arg.Any<CancellationToken>());
|
||||
|
||||
+7
-2
@@ -34,7 +34,9 @@ public class CreateUserCommandHandlerTests
|
||||
|
||||
Assert.True(result.IsSuccess);
|
||||
Assert.Equal(userId, result.Value);
|
||||
await _roleService.Received(1).ChangeUserRoleAsync(userId, roleId, Arg.Any<CancellationToken>());
|
||||
await _roleService
|
||||
.Received(1)
|
||||
.ChangeUserRoleAsync(userId, roleId, Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -43,7 +45,10 @@ public class CreateUserCommandHandlerTests
|
||||
_roleService.ListRolesAsync(Arg.Any<CancellationToken>()).Returns(new List<RoleDto>());
|
||||
|
||||
var result = await CreateHandler()
|
||||
.Handle(new CreateUserCommand("bob", "Password1", Guid.NewGuid()), CancellationToken.None);
|
||||
.Handle(
|
||||
new CreateUserCommand("bob", "Password1", Guid.NewGuid()),
|
||||
CancellationToken.None
|
||||
);
|
||||
|
||||
Assert.False(result.IsSuccess);
|
||||
Assert.Equal(RoleErrors.NotFound, result.Error);
|
||||
|
||||
Reference in New Issue
Block a user