mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 13:11:10 +00:00
eliminates region sections
This commit is contained in:
1 parent
705c02b90d
commit
405fc1ff9a
370 files changed
+47
-1618
No files matched your search
-6
@@ -21,12 +21,9 @@ namespace Lumina.Application.UnitTests.Common.Behaviors;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ValidationBehaviorTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IValidator<ValidationBehaviorFixture> _mockValidator;
|
||||
private readonly MessageHandlerDelegate<ValidationBehaviorFixture, ErrorOr<ValidationBehaviorTestResponse>> _nextDelegate;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ValidationBehaviorTests"/> class.
|
||||
/// </summary>
|
||||
@@ -35,9 +32,7 @@ public class ValidationBehaviorTests
|
||||
_mockValidator = Substitute.For<IValidator<ValidationBehaviorFixture>>();
|
||||
_nextDelegate = Substitute.For<MessageHandlerDelegate<ValidationBehaviorFixture, ErrorOr<ValidationBehaviorTestResponse>>>();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public async Task Handle_WhenValidatorIsNull_ShouldInvokeNextDelegate()
|
||||
{
|
||||
@@ -102,5 +97,4 @@ public class ValidationBehaviorTests
|
||||
await _mockValidator.Received(1).ValidateAsync(request, Arg.Any<CancellationToken>());
|
||||
await _nextDelegate.DidNotReceive().Invoke(request, Arg.Any<CancellationToken>());
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -18,11 +18,8 @@ namespace Lumina.Application.UnitTests.Common.Converters;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class OptionalJsonConverterFactoryTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly OptionalJsonConverterFactory _factory;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OptionalJsonConverterFactoryTests"/> class.
|
||||
/// </summary>
|
||||
@@ -30,9 +27,7 @@ public class OptionalJsonConverterFactoryTests
|
||||
{
|
||||
_factory = new OptionalJsonConverterFactory();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void CanConvert_WhenTypeIsOptional_ShouldReturnTrue()
|
||||
{
|
||||
@@ -113,5 +108,4 @@ public class OptionalJsonConverterFactoryTests
|
||||
// Assert
|
||||
converter.Should().BeOfType<OptionalJsonConverter<OptionalJsonConverterFactoryFixture>>();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -14,11 +14,8 @@ namespace Lumina.Application.UnitTests.Common.Converters;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class OptionalJsonConverterTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly JsonSerializerOptions _options;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OptionalJsonConverterTests"/> class.
|
||||
/// </summary>
|
||||
@@ -28,9 +25,7 @@ public class OptionalJsonConverterTests
|
||||
_options.Converters.Add(new OptionalJsonConverter<string>());
|
||||
_options.Converters.Add(new OptionalJsonConverter<int>());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Read_WhenJsonIsNull_ShouldReturnNone()
|
||||
{
|
||||
@@ -138,5 +133,4 @@ public class OptionalJsonConverterTests
|
||||
// Assert
|
||||
deserialized.Should().Be(original);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -20,13 +20,10 @@ namespace Lumina.Application.UnitTests.Common.Mapping.FileManagement;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class DirectoryMappingConfigTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly TypeAdapterConfig _config;
|
||||
private readonly DirectoryMappingConfig _directoryMappingConfig;
|
||||
private readonly FileSystemTreeMappingConfig _fileSystemTreeMappingConfig;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
public DirectoryMappingConfigTests()
|
||||
{
|
||||
_config = new TypeAdapterConfig();
|
||||
@@ -35,9 +32,7 @@ public class DirectoryMappingConfigTests
|
||||
_directoryMappingConfig.Register(_config);
|
||||
_fileSystemTreeMappingConfig.Register(_config);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Register_WhenMappingDirectoryToFileSystemTreeNodeResponse_ShouldMapCorrectly()
|
||||
{
|
||||
@@ -115,5 +110,4 @@ public class DirectoryMappingConfigTests
|
||||
result.DateCreated.Should().BeOnOrAfter(beforeMapping).And.BeOnOrBefore(afterMapping);
|
||||
result.DateModified.Should().BeOnOrAfter(beforeMapping).And.BeOnOrBefore(afterMapping);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -16,13 +16,10 @@ namespace Lumina.Application.UnitTests.Common.Mapping.FileManagement;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileMappingConfigTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly TypeAdapterConfig _config;
|
||||
private readonly FileMappingConfig _fileMappingConfig;
|
||||
private readonly FileSystemTreeMappingConfig _fileSystemTreeMappingConfig;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
public FileMappingConfigTests()
|
||||
{
|
||||
_config = new TypeAdapterConfig();
|
||||
@@ -31,9 +28,7 @@ public class FileMappingConfigTests
|
||||
_fileMappingConfig.Register(_config);
|
||||
_fileSystemTreeMappingConfig.Register(_config);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Register_WhenMappingFileToFileSystemTreeNodeResponse_ShouldMapCorrectly()
|
||||
{
|
||||
@@ -91,5 +86,4 @@ public class FileMappingConfigTests
|
||||
result.DateModified.Should().Be(default);
|
||||
result.Size.Should().Be(file.Size);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -18,21 +18,16 @@ namespace Lumina.Application.UnitTests.Common.Mapping.FileManagement;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class FileSystemTreeMappingConfigTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly TypeAdapterConfig _config;
|
||||
private readonly FileSystemTreeMappingConfig _fileSystemTreeMappingConfig;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
public FileSystemTreeMappingConfigTests()
|
||||
{
|
||||
_config = new TypeAdapterConfig();
|
||||
_fileSystemTreeMappingConfig = new FileSystemTreeMappingConfig();
|
||||
_fileSystemTreeMappingConfig.Register(_config);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Register_WhenMappingWindowsRootItemToFileSystemTreeNodeResponse_ShouldMapCorrectly()
|
||||
{
|
||||
@@ -160,5 +155,4 @@ public class FileSystemTreeMappingConfigTests
|
||||
result.ChildrenLoaded.Should().BeFalse();
|
||||
result.Children.Should().BeEmpty();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -17,21 +17,16 @@ namespace Lumina.Application.UnitTests.Common.Mapping.FileManagement;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class PathSegmentMappingConfigTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly TypeAdapterConfig _config;
|
||||
private readonly PathSegmentMappingConfig _pathSegmentMappingConfig;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
public PathSegmentMappingConfigTests()
|
||||
{
|
||||
_config = new TypeAdapterConfig();
|
||||
_pathSegmentMappingConfig = new PathSegmentMappingConfig();
|
||||
_pathSegmentMappingConfig.Register(_config);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Register_WhenMappingPathSegmentToPathSegmentResponse_ShouldMapCorrectly()
|
||||
{
|
||||
@@ -90,5 +85,4 @@ public class PathSegmentMappingConfigTests
|
||||
results[i].Path.Should().Be(pathSegments[i].Name);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -18,13 +18,10 @@ namespace Lumina.Application.UnitTests.Common.Mapping.FileManagement;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ThumbnailMappingConfigTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly TypeAdapterConfig _config;
|
||||
private readonly ThumbnailMappingConfig _thumbnailMappingConfig;
|
||||
private readonly Faker _faker;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
public ThumbnailMappingConfigTests()
|
||||
{
|
||||
_config = new TypeAdapterConfig();
|
||||
@@ -32,9 +29,7 @@ public class ThumbnailMappingConfigTests
|
||||
_thumbnailMappingConfig.Register(_config);
|
||||
_faker = new Faker();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Register_WhenMappingThumbnailToThumbnailResponse_ShouldMapCorrectly()
|
||||
{
|
||||
@@ -111,5 +106,4 @@ public class ThumbnailMappingConfigTests
|
||||
results[i].Bytes.Should().BeEquivalentTo(thumbnails[i].Bytes);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Common.Setup;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public static class BogusExtensions
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Adds <see cref="DateOnly"/> random data generation support to the <see cref="Faker"/> class.
|
||||
/// </summary>
|
||||
@@ -36,5 +35,4 @@ public static class BogusExtensions
|
||||
DateTime endDateTime = end.ToDateTime(TimeOnly.MinValue);
|
||||
return System.DateOnly.FromDateTime(faker.Date.Between(startDateTime, endDateTime));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Common.Setup;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class DateOnlySpecimenBuilder : ISpecimenBuilder
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Adds <see cref="DateOnly"/> support to the AutoFixture library.
|
||||
/// </summary>
|
||||
@@ -25,5 +24,4 @@ public class DateOnlySpecimenBuilder : ISpecimenBuilder
|
||||
return DateOnly.FromDateTime(DateTime.Now);
|
||||
return new NoSpecimen();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-2
@@ -12,7 +12,6 @@ namespace Lumina.Application.UnitTests.Common.Setup;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class NullableDateOnlySpecimenBuilder : ISpecimenBuilder
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Adds <see cref="DateOnly?"/> support to the AutoFixture library.
|
||||
/// </summary>
|
||||
@@ -25,5 +24,4 @@ public class NullableDateOnlySpecimenBuilder : ISpecimenBuilder
|
||||
return (DateOnly?)DateOnly.FromDateTime(DateTime.Now);
|
||||
return new NoSpecimen();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in new issue
Block a user