mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 09:11:10 +00:00
Removes the redundant contract and enumeration tests
This commit is contained in:
1 parent
4dce426b38
commit
dc2692e208
127 files changed
-6721
No files matched your search
-25
@@ -3,8 +3,6 @@ using Lumina.Domain.SharedKernel.Common.Enums.PhotoLibrary;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.SharedKernel.UnitTests.Common.Enums.PhotoLibrary;
|
||||
@@ -15,12 +13,6 @@ namespace Lumina.Domain.SharedKernel.UnitTests.Common.Enums.PhotoLibrary;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class ImageTypeTests
|
||||
{
|
||||
private readonly JsonSerializerOptions _jsonOptions = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void ImageType_WhenEnumeratingValues_ShouldHaveNoDuplicateValues()
|
||||
{
|
||||
@@ -29,7 +21,6 @@ public class ImageTypeTests
|
||||
|
||||
// Assert
|
||||
Assert.Equal(values.Length, values.Distinct().Count());
|
||||
Assert.All(values, value => Assert.True(Enum.IsDefined(value)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -41,20 +32,4 @@ public class ImageTypeTests
|
||||
// Assert
|
||||
Assert.Equal(0, value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RoundTrip_WhenSerializingWithCamelCaseConverter_ShouldPreserveEnumValue()
|
||||
{
|
||||
// Arrange
|
||||
foreach (ImageType value in Enum.GetValues<ImageType>())
|
||||
{
|
||||
// Act
|
||||
string json = JsonSerializer.Serialize(value, _jsonOptions);
|
||||
ImageType deserialized = JsonSerializer.Deserialize<ImageType>(json, _jsonOptions);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(value, deserialized);
|
||||
Assert.StartsWith("\"", json, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
-25
@@ -3,8 +3,6 @@ using Lumina.Domain.SharedKernel.Common.Enums.PhotoLibrary;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.SharedKernel.UnitTests.Common.Enums.PhotoLibrary;
|
||||
@@ -15,12 +13,6 @@ namespace Lumina.Domain.SharedKernel.UnitTests.Common.Enums.PhotoLibrary;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class VisualContentTypeTests
|
||||
{
|
||||
private readonly JsonSerializerOptions _jsonOptions = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void VisualContentType_WhenEnumeratingValues_ShouldHaveNoDuplicateValues()
|
||||
{
|
||||
@@ -29,22 +21,5 @@ public class VisualContentTypeTests
|
||||
|
||||
// Assert
|
||||
Assert.Equal(values.Length, values.Distinct().Count());
|
||||
Assert.All(values, value => Assert.True(Enum.IsDefined(value)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RoundTrip_WhenSerializingWithCamelCaseConverter_ShouldPreserveEnumValue()
|
||||
{
|
||||
// Arrange
|
||||
foreach (VisualContentType value in Enum.GetValues<VisualContentType>())
|
||||
{
|
||||
// Act
|
||||
string json = JsonSerializer.Serialize(value, _jsonOptions);
|
||||
VisualContentType deserialized = JsonSerializer.Deserialize<VisualContentType>(json, _jsonOptions);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(value, deserialized);
|
||||
Assert.StartsWith("\"", json, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user