Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -44,14 +52,14 @@
{
// Arrange
// Use a canonical all-zero UUID representation which is commonly accepted by UUID parsers.
const string input = "00000000-0000-0000-0000-000000000000";

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

The variable 'input' is assigned but its value is never used

See more on https://sonarcloud.io/project/issues?id=TensionDev_UUID.Serialization.SystemTextJson&issues=AZy9OTSh-MoHR9pb1OVB&open=AZy9OTSh-MoHR9pb1OVB&pullRequest=9

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used

Check warning on line 55 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used
string jsonText = "0";
byte[] json = Encoding.UTF8.GetBytes(jsonText);
var reader = new Utf8JsonReader(json);
reader.Read();

// Act
JsonException ex = null;

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Converting null literal or possible null value to non-nullable type.

See more on https://sonarcloud.io/project/issues?id=TensionDev_UUID.Serialization.SystemTextJson&issues=AZy9OTSh-MoHR9pb1OVA&open=AZy9OTSh-MoHR9pb1OVA&pullRequest=9

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.

Check warning on line 62 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.
try
{
_converter.Read(ref reader, typeof(Uuid), new JsonSerializerOptions());
Expand All @@ -70,14 +78,14 @@
{
// Arrange
// Use a canonical all-zero UUID representation which is commonly accepted by UUID parsers.
const string input = "00000000-0000-0000-0000-000000000000";

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

The variable 'input' is assigned but its value is never used

See more on https://sonarcloud.io/project/issues?id=TensionDev_UUID.Serialization.SystemTextJson&issues=AZy9OTSh-MoHR9pb1OVD&open=AZy9OTSh-MoHR9pb1OVD&pullRequest=9

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used

Check warning on line 81 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

The variable 'input' is assigned but its value is never used
string jsonText = "\"\"";
byte[] json = Encoding.UTF8.GetBytes(jsonText);
var reader = new Utf8JsonReader(json);
reader.Read();

// Act
JsonException ex = null;

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on macos-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on ubuntu-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x on windows-latest

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Converting null literal or possible null value to non-nullable type.

See more on https://sonarcloud.io/project/issues?id=TensionDev_UUID.Serialization.SystemTextJson&issues=AZy9OTSh-MoHR9pb1OVC&open=AZy9OTSh-MoHR9pb1OVC&pullRequest=9

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.

Check warning on line 88 in TensionDev.UUID.Serialization.SystemTextJson.Tests/UuidSystemTextJsonConverterTests.cs

View workflow job for this annotation

GitHub Actions / .NET 8.0.x

Converting null literal or possible null value to non-nullable type.
try
{
_converter.Read(ref reader, typeof(Uuid), new JsonSerializerOptions());
Expand All @@ -91,12 +99,15 @@
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);
Expand Down Expand Up @@ -126,7 +137,7 @@
}

// // 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageId>TensionDev.UUID.Serialization.SystemTextJson</PackageId>
<Version>2.0.0</Version>
<Version>2.1.0</Version>
<Authors>TensionDev amsga</Authors>
<Company>TensionDev</Company>
<Product>TensionDev.UUID.Serialization.SystemTextJson</Product>
Expand All @@ -37,7 +37,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="TensionDev.UUID" Version="2.0.0" />
<PackageReference Include="TensionDev.UUID" Version="2.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
Expand All @@ -50,16 +50,4 @@
<PackageReference Include="System.Text.Json" Version="4.7.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="System.Text.Json" Version="6.0.11" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="System.Text.Json" Version="8.0.6" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="System.Text.Json" Version="10.0.0" />
</ItemGroup>

</Project>