mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 08: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.BookLibrary;
|
||||
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.BookLibrary;
|
||||
@@ -15,12 +13,6 @@ namespace Lumina.Domain.SharedKernel.UnitTests.Common.Enums.BookLibrary;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookFormatTests
|
||||
{
|
||||
private readonly JsonSerializerOptions _jsonOptions = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void BookFormat_WhenEnumeratingValues_ShouldHaveNoDuplicateValues()
|
||||
{
|
||||
@@ -29,22 +21,5 @@ public class BookFormatTests
|
||||
|
||||
// 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 (BookFormat value in Enum.GetValues<BookFormat>())
|
||||
{
|
||||
// Act
|
||||
string json = JsonSerializer.Serialize(value, _jsonOptions);
|
||||
BookFormat deserialized = JsonSerializer.Deserialize<BookFormat>(json, _jsonOptions);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(value, deserialized);
|
||||
Assert.StartsWith("\"", json, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
-25
@@ -3,8 +3,6 @@ using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
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.BookLibrary;
|
||||
@@ -15,12 +13,6 @@ namespace Lumina.Domain.SharedKernel.UnitTests.Common.Enums.BookLibrary;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookRatingSourceTests
|
||||
{
|
||||
private readonly JsonSerializerOptions _jsonOptions = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void BookRatingSource_WhenEnumeratingValues_ShouldHaveNoDuplicateValues()
|
||||
{
|
||||
@@ -29,22 +21,5 @@ public class BookRatingSourceTests
|
||||
|
||||
// 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 (BookRatingSource value in Enum.GetValues<BookRatingSource>())
|
||||
{
|
||||
// Act
|
||||
string json = JsonSerializer.Serialize(value, _jsonOptions);
|
||||
BookRatingSource deserialized = JsonSerializer.Deserialize<BookRatingSource>(json, _jsonOptions);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(value, deserialized);
|
||||
Assert.StartsWith("\"", json, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
-25
@@ -3,8 +3,6 @@ using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
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.BookLibrary;
|
||||
@@ -15,12 +13,6 @@ namespace Lumina.Domain.SharedKernel.UnitTests.Common.Enums.BookLibrary;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class IsbnFormatTests
|
||||
{
|
||||
private readonly JsonSerializerOptions _jsonOptions = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void IsbnFormat_WhenEnumeratingValues_ShouldHaveNoDuplicateValues()
|
||||
{
|
||||
@@ -29,22 +21,5 @@ public class IsbnFormatTests
|
||||
|
||||
// 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 (IsbnFormat value in Enum.GetValues<IsbnFormat>())
|
||||
{
|
||||
// Act
|
||||
string json = JsonSerializer.Serialize(value, _jsonOptions);
|
||||
IsbnFormat deserialized = JsonSerializer.Deserialize<IsbnFormat>(json, _jsonOptions);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(value, deserialized);
|
||||
Assert.StartsWith("\"", json, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
-25
@@ -3,8 +3,6 @@ using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
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.BookLibrary;
|
||||
@@ -15,12 +13,6 @@ namespace Lumina.Domain.SharedKernel.UnitTests.Common.Enums.BookLibrary;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class MetadataStatusTests
|
||||
{
|
||||
private readonly JsonSerializerOptions _jsonOptions = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void MetadataStatus_WhenEnumeratingValues_ShouldHaveNoDuplicateValues()
|
||||
{
|
||||
@@ -29,22 +21,5 @@ public class MetadataStatusTests
|
||||
|
||||
// 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 (MetadataStatus value in Enum.GetValues<MetadataStatus>())
|
||||
{
|
||||
// Act
|
||||
string json = JsonSerializer.Serialize(value, _jsonOptions);
|
||||
MetadataStatus deserialized = JsonSerializer.Deserialize<MetadataStatus>(json, _jsonOptions);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(value, deserialized);
|
||||
Assert.StartsWith("\"", json, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
-25
@@ -3,8 +3,6 @@ using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
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.BookLibrary;
|
||||
@@ -15,12 +13,6 @@ namespace Lumina.Domain.SharedKernel.UnitTests.Common.Enums.BookLibrary;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class WrittenContentTypeTests
|
||||
{
|
||||
private readonly JsonSerializerOptions _jsonOptions = new()
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void WrittenContentType_WhenEnumeratingValues_ShouldHaveNoDuplicateValues()
|
||||
{
|
||||
@@ -29,22 +21,5 @@ public class WrittenContentTypeTests
|
||||
|
||||
// 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 (WrittenContentType value in Enum.GetValues<WrittenContentType>())
|
||||
{
|
||||
// Act
|
||||
string json = JsonSerializer.Serialize(value, _jsonOptions);
|
||||
WrittenContentType deserialized = JsonSerializer.Deserialize<WrittenContentType>(json, _jsonOptions);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(value, deserialized);
|
||||
Assert.StartsWith("\"", json, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user