diff --git a/CHANGELOG.md b/CHANGELOG.md index 36e850a..b975776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v2.1.0] - 2026-03-05 +[v2.1.0](https://github.com/TensionDev/UUID.Serialization.SystemTextJson/releases/tag/v2.1.0) + +### Changed +- Changed to reference TensionDev.UUID v2.1.0. + + ## [v2.0.0] - 2026-03-04 [v2.0.0](https://github.com/TensionDev/UUID.Serialization.SystemTextJson/releases/tag/v2.0.0) diff --git a/TensionDev.UUID.Serialization.SystemTextJson.Tests/TestUuidSystemTextJsonConverter.cs b/TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs similarity index 75% rename from TensionDev.UUID.Serialization.SystemTextJson.Tests/TestUuidSystemTextJsonConverter.cs rename to TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs index f335e5c..e6482b3 100644 --- a/TensionDev.UUID.Serialization.SystemTextJson.Tests/TestUuidSystemTextJsonConverter.cs +++ b/TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs @@ -7,26 +7,34 @@ namespace TensionDev.UUID.Serialization.SystemTextJson.Tests { - public class TestUuidSystemTextJsonConverter : IDisposable + public class UuidSystemTextJsonConverterTests : IDisposable { private bool disposedValue; private readonly UuidSystemTextJsonConverter _converter; - public TestUuidSystemTextJsonConverter() + public UuidSystemTextJsonConverterTests() { _converter = new UuidSystemTextJsonConverter(); } [Theory] - [InlineData(true)] - [InlineData(false)] - public void TestWrite(bool useNullOptions) + [InlineData(true, "00000000-0000-0000-0000-000000000000")] + [InlineData(true, "ffffffff-ffff-ffff-ffff-ffffffffffff")] + [InlineData(true, "164a714c-0c79-11ec-82a8-0242ac130003")] + [InlineData(true, "550e8400-e29b-41d4-a716-446655440000")] + [InlineData(true, "1bf6935b-49e6-54cf-a9c8-51fb21c41b46")] + [InlineData(false, "00000000-0000-0000-0000-000000000000")] + [InlineData(false, "ffffffff-ffff-ffff-ffff-ffffffffffff")] + [InlineData(false, "164a714c-0c79-11ec-82a8-0242ac130003")] + [InlineData(false, "550e8400-e29b-41d4-a716-446655440000")] + [InlineData(false, "1bf6935b-49e6-54cf-a9c8-51fb21c41b46")] + public void TestWrite(bool useNullOptions, string input) { // Arrange using var ms = new MemoryStream(); using var writer = new Utf8JsonWriter(ms); - Uuid value = new Uuid(); + Uuid value = Uuid.Parse(input); JsonSerializerOptions? options = useNullOptions ? null : new JsonSerializerOptions(); // Act @@ -91,12 +99,15 @@ public void TestReadEmptyString() Assert.NotNull(ex); } - [Fact] - public void TestReadString() + [Theory] + [InlineData("00000000-0000-0000-0000-000000000000")] + [InlineData("ffffffff-ffff-ffff-ffff-ffffffffffff")] + [InlineData("164a714c-0c79-11ec-82a8-0242ac130003")] + [InlineData("550e8400-e29b-41d4-a716-446655440000")] + [InlineData("1bf6935b-49e6-54cf-a9c8-51fb21c41b46")] + public void TestReadString(string input) { // Arrange - // Use a canonical all-zero UUID representation which is commonly accepted by UUID parsers. - const string input = "00000000-0000-0000-0000-000000000000"; string jsonText = "\"" + input + "\""; byte[] json = Encoding.UTF8.GetBytes(jsonText); var reader = new Utf8JsonReader(json); @@ -126,7 +137,7 @@ protected virtual void Dispose(bool disposing) } // // TODO: override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources - // ~TestUuidSystemTextJsonConverter() + // ~UuidSystemTextJsonConverterTests() // { // // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method // Dispose(disposing: false); diff --git a/TensionDev.UUID.Serialization.SystemTextJson/TensionDev.UUID.Serialization.SystemTextJson.csproj b/TensionDev.UUID.Serialization.SystemTextJson/TensionDev.UUID.Serialization.SystemTextJson.csproj index f2e820b..564590e 100644 --- a/TensionDev.UUID.Serialization.SystemTextJson/TensionDev.UUID.Serialization.SystemTextJson.csproj +++ b/TensionDev.UUID.Serialization.SystemTextJson/TensionDev.UUID.Serialization.SystemTextJson.csproj @@ -10,7 +10,7 @@ true true TensionDev.UUID.Serialization.SystemTextJson - 2.0.0 + 2.1.0 TensionDev amsga TensionDev TensionDev.UUID.Serialization.SystemTextJson @@ -37,7 +37,7 @@ - + @@ -50,16 +50,4 @@ - - - - - - - - - - - -