Formats code comments as sentences in the tests.

Capitalizes the first word and adds the terminal period in the unit, integration and security tests. The AAA markers stay bare, the TODO bodies stay lowercase, and no assertion, payload, expected status code or test signature changes.
This commit is contained in:
BinaryAlley committed 2026-11-16 18:17:29 +02:00
1 parent 727aa33318
commit 057f557791
540 files changed
+3888 -3888

No files matched your search

@@ -79,7 +79,7 @@ public class LibraryScanConfigurationTests
public void Configure_WhenApplied_ShouldConfigureDescendingIndexOnLibraryIdStatusAndCreatedOnUtc()
{
// Arrange
// the read-optimized runtime model does not store the index sort order, so the design-time model is inspected instead
// The read-optimized runtime model does not store the index sort order, so the design-time model is inspected instead.
IDesignTimeModel designTimeModel = _context.GetService<IDesignTimeModel>();
IEntityType entityType = designTimeModel.Model.FindEntityType(typeof(LibraryScanEntity))!;
@@ -25,7 +25,7 @@ public class DataAccessLayerServicesTests
{
// Arrange
ServiceCollection services = new();
string basePath = Path.GetTempPath(); // use a real existing path
string basePath = Path.GetTempPath(); // Use a real existing path.
// Act
DataAccessLayerServices.AddDataAccessLayerServices(services);
@@ -102,8 +102,8 @@ public class EditableValuesCopierTests
}
[Theory]
[InlineData(false)] // the incoming entity carries a different, non-empty key
[InlineData(true)] // the incoming entity carries an unset key
[InlineData(false)] // The incoming entity carries a different, non-empty key.
[InlineData(true)] // The incoming entity carries an unset key.
public async Task CopyEditableValues_WhenTheIncomingKeyDoesNotMatchTheTrackedOne_ShouldPreserveTheTrackedIdentity(bool useUnsetKey)
{
// Arrange
@@ -7,7 +7,7 @@ using System.Diagnostics.CodeAnalysis;
namespace Lumina.DataAccess.UnitTests.Common.Setup;
/// <summary>
/// Service for time related concerns
/// Service for time related concerns.
/// </summary>
[ExcludeFromCodeCoverage]
public class TestDateTimeProvider : IDateTimeProvider
@@ -52,7 +52,7 @@ public class PermissionRepositoryTests
Assert.False(result.IsFailure);
Assert.Equal(Result.Created, result.Value);
// check if the permission was added to the context's ChangeTracker
// Check if the permission was added to the context's ChangeTracker.
EntityEntry<PermissionEntity>? addedPermission = _mockContext.ChangeTracker.Entries<PermissionEntity>()
.FirstOrDefault(e => e.State == EntityState.Added && e.Entity.Id == permissionModel.Id);
Assert.NotNull(addedPermission);
@@ -47,7 +47,7 @@ public class RolePermissionRepositoryTests
Assert.False(result.IsFailure);
Assert.Equal(Result.Created, result.Value);
// check if the role permission was added to the context's ChangeTracker
// Check if the role permission was added to the context's ChangeTracker.
EntityEntry<RolePermissionEntity>? addedRolePermission = _mockContext.ChangeTracker.Entries<RolePermissionEntity>()
.FirstOrDefault(e => e.State == EntityState.Added && e.Entity.Id == rolePermissionModel.Id);
Assert.NotNull(addedRolePermission);
@@ -53,7 +53,7 @@ public class RoleRepositoryTests
Assert.False(result.IsFailure);
Assert.Equal(Result.Created, result.Value);
// Check if the role was added to the context's ChangeTracker
// Check if the role was added to the context's ChangeTracker.
EntityEntry<RoleEntity>? addedRole = _mockContext.ChangeTracker.Entries<RoleEntity>()
.FirstOrDefault(e => e.State == EntityState.Added && e.Entity.Id == role.Id);
Assert.NotNull(addedRole);
@@ -806,14 +806,14 @@ public class ArtistRepositoryTests
}
[Theory]
[InlineData("website", SortOrder.Ascending)] // the website field, ascending
[InlineData("website", SortOrder.Descending)] // the website field, descending
[InlineData("musicbrainzartistid", SortOrder.Ascending)] // the MusicBrainz artist Id field, ascending
[InlineData("musicbrainzartistid", SortOrder.Descending)] // the MusicBrainz artist Id field, descending
[InlineData("createdonutc", SortOrder.Ascending)] // the creation timestamp field, ascending
[InlineData("createdonutc", SortOrder.Descending)] // the creation timestamp field, descending
[InlineData("updatedonutc", SortOrder.Ascending)] // the update timestamp field, ascending
[InlineData("updatedonutc", SortOrder.Descending)] // the update timestamp field, descending
[InlineData("website", SortOrder.Ascending)] // The website field, ascending.
[InlineData("website", SortOrder.Descending)] // The website field, descending.
[InlineData("musicbrainzartistid", SortOrder.Ascending)] // The MusicBrainz artist Id field, ascending.
[InlineData("musicbrainzartistid", SortOrder.Descending)] // The MusicBrainz artist Id field, descending.
[InlineData("createdonutc", SortOrder.Ascending)] // The creation timestamp field, ascending.
[InlineData("createdonutc", SortOrder.Descending)] // The creation timestamp field, descending.
[InlineData("updatedonutc", SortOrder.Ascending)] // The update timestamp field, ascending.
[InlineData("updatedonutc", SortOrder.Descending)] // The update timestamp field, descending.
public async Task GetAllAsync_WhenSortedByField_ShouldOrderByFieldThenById(string sortBy, SortOrder sortOrder)
{
// Arrange
@@ -147,7 +147,7 @@ public class UserRepositoryTests
_mockContext.Users.Add(existingUser);
await _mockContext.SaveChangesAsync();
// Create updated user with same Id but different properties
// Create updated user with same Id but different properties.
UserEntity updatedUser = _userEntityFixture.Create(id: existingUser.Id, username: existingUser.Username, password: "NewPassword123");
updatedUser.TempPassword = "TempPass456";
updatedUser.TotpSecret = "NewSecret";
@@ -403,7 +403,7 @@ public class DataSeedServiceTests
Guid userId = Guid.NewGuid();
RoleEntity adminRole = _roleEntityFixture.Create(roleName: "Admin");
UserEntity adminUser = _userEntityFixture.Create();
// Use the adminUser.Id instead of the randomly generated userId
// Use the adminUser.Id instead of the randomly generated userId.
userId = adminUser.Id;
IRoleRepository mockRoleRepository = Substitute.For<IRoleRepository>();