diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a7d9843..be47d5b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -16,7 +16,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
- dotnet-version: "8.0.x"
+ dotnet-version: "9.x"
- name: Build with dotnet
run: dotnet build --configuration Release
- name: Test with dotnet
@@ -28,7 +28,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
- dotnet-version: "8.0.x"
+ dotnet-version: "9.x"
- name: Build with dotnet
run: dotnet build --configuration Release
- name: Test with dotnet
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 69a3d3b..55f3b85 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -14,22 +14,22 @@ jobs:
Protobuf.System.Text.Json
]
steps:
- - uses: actions/checkout@v1
+ - uses: actions/checkout@v2 # Updated to v2 for better performance and new features
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
- dotnet-version: "8.0.x"
+ dotnet-version: "9.x"
- name: Create NuGet Package
run: dotnet pack -c Release /p:Version=${{ github.event.release.name }} /p:PackageReleaseNotes="See https://github.com/Havret/Protobuf.System.Text.Json/releases/tag/${{ github.event.release.tag_name }}"
- name: Archive NuGet Package
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4 # Migrated to v4
with:
name: ${{ matrix.package }}
path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.nupkg
- name: Archive NuGet Package With Symbols
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4 # Migrated to v4
with:
- name: ${{ matrix.package }}
+ name: ${{ matrix.package }}-symbols
path: ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.snupkg
- name: Publish NuGet Package
run: dotnet nuget push ./src/${{ matrix.package }}/bin/Release/${{ matrix.package }}.${{ github.event.release.name }}.nupkg --api-key ${{ secrets.nuget_api_key }} --source https://api.nuget.org/v3/index.json
diff --git a/benchmark/Protobuf.System.Text.Json.Benchmark.MessageWithOneOfs/Protobuf.System.Text.Json.Benchmark.MessageWithOneOfs.csproj b/benchmark/Protobuf.System.Text.Json.Benchmark.MessageWithOneOfs/Protobuf.System.Text.Json.Benchmark.MessageWithOneOfs.csproj
index a384f24..bcf9437 100644
--- a/benchmark/Protobuf.System.Text.Json.Benchmark.MessageWithOneOfs/Protobuf.System.Text.Json.Benchmark.MessageWithOneOfs.csproj
+++ b/benchmark/Protobuf.System.Text.Json.Benchmark.MessageWithOneOfs/Protobuf.System.Text.Json.Benchmark.MessageWithOneOfs.csproj
@@ -2,17 +2,17 @@
Exe
- net8.0
+ net9.0
enable
enable
false
-
-
-
-
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/benchmark/Protobuf.System.Text.Json.Benchmark.MessageWithRepeatedFields/Protobuf.System.Text.Json.Benchmark.MessageWithRepeatedFields.csproj b/benchmark/Protobuf.System.Text.Json.Benchmark.MessageWithRepeatedFields/Protobuf.System.Text.Json.Benchmark.MessageWithRepeatedFields.csproj
index 9d95110..1e27cb8 100644
--- a/benchmark/Protobuf.System.Text.Json.Benchmark.MessageWithRepeatedFields/Protobuf.System.Text.Json.Benchmark.MessageWithRepeatedFields.csproj
+++ b/benchmark/Protobuf.System.Text.Json.Benchmark.MessageWithRepeatedFields/Protobuf.System.Text.Json.Benchmark.MessageWithRepeatedFields.csproj
@@ -2,17 +2,17 @@
Exe
- net8.0
+ net9.0
enable
enable
false
-
-
-
-
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/benchmark/Protobuf.System.Text.Json.Benchmark.Shared/Protobuf.System.Text.Json.Benchmark.Shared.csproj b/benchmark/Protobuf.System.Text.Json.Benchmark.Shared/Protobuf.System.Text.Json.Benchmark.Shared.csproj
index adcc478..5136ca0 100644
--- a/benchmark/Protobuf.System.Text.Json.Benchmark.Shared/Protobuf.System.Text.Json.Benchmark.Shared.csproj
+++ b/benchmark/Protobuf.System.Text.Json.Benchmark.Shared/Protobuf.System.Text.Json.Benchmark.Shared.csproj
@@ -1,14 +1,14 @@
- net8.0
+ net9.0
enable
enable
false
-
+
diff --git a/benchmark/Protobuf.System.Text.Json.Benchmark.SimpleMessage/Protobuf.System.Text.Json.Benchmark.SimpleMessage.csproj b/benchmark/Protobuf.System.Text.Json.Benchmark.SimpleMessage/Protobuf.System.Text.Json.Benchmark.SimpleMessage.csproj
index a384f24..bcf9437 100644
--- a/benchmark/Protobuf.System.Text.Json.Benchmark.SimpleMessage/Protobuf.System.Text.Json.Benchmark.SimpleMessage.csproj
+++ b/benchmark/Protobuf.System.Text.Json.Benchmark.SimpleMessage/Protobuf.System.Text.Json.Benchmark.SimpleMessage.csproj
@@ -2,17 +2,17 @@
Exe
- net8.0
+ net9.0
enable
enable
false
-
-
-
-
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Protobuf.System.Text.Json/Protobuf.System.Text.Json.csproj b/src/Protobuf.System.Text.Json/Protobuf.System.Text.Json.csproj
index 7f6a68b..7720b4f 100644
--- a/src/Protobuf.System.Text.Json/Protobuf.System.Text.Json.csproj
+++ b/src/Protobuf.System.Text.Json/Protobuf.System.Text.Json.csproj
@@ -3,8 +3,8 @@
System.Text.Json extensions for Protobuf types.
System.Text.Json extensions for Protobuf types.
- net8.0;net6.0;netstandard2.0;netstandard2.1
- 12
+ net9.0;net8.0;netstandard2.0;netstandard2.1
+ 13.0
https://github.com/Havret/System.Text.Json.Protobuf
Protobuf.System.Text.Json
https://github.com/Havret/System.Text.Json.Protobuf/blob/main/LICENSE
@@ -22,8 +22,8 @@
-
-
+
+
diff --git a/test/Protobuf.System.Text.Json.Tests/ContractEvolutionTests.cs b/test/Protobuf.System.Text.Json.Tests/ContractEvolutionTests.cs
index ef47041..163b963 100644
--- a/test/Protobuf.System.Text.Json.Tests/ContractEvolutionTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/ContractEvolutionTests.cs
@@ -1,7 +1,6 @@
using System.Text.Json;
using System.Text.Json.Protobuf.Tests;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using Xunit;
namespace Protobuf.System.Text.Json.Tests;
@@ -25,8 +24,8 @@ public void Should_deserialize_a_new_version_of_a_message_using_the_old_version_
var deserialized = JsonSerializer.Deserialize(payload, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.DoubleProperty.ShouldBe(msg.DoubleProperty);
+ Assert.NotNull(deserialized);
+ Assert.Equal(msg.DoubleProperty, deserialized.DoubleProperty);
}
[Fact]
@@ -44,7 +43,7 @@ public void Should_deserialize_the_old_version_of_a_message_using_the_new_versio
var deserialized = JsonSerializer.Deserialize(payload, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.DoubleProperty.ShouldBe(msg.DoubleProperty);
+ Assert.NotNull(deserialized);
+ Assert.Equal(msg.DoubleProperty, deserialized.DoubleProperty);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/MessageWithComplexPropertyTests.cs b/test/Protobuf.System.Text.Json.Tests/MessageWithComplexPropertyTests.cs
index dcc9f8c..4d734ef 100644
--- a/test/Protobuf.System.Text.Json.Tests/MessageWithComplexPropertyTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/MessageWithComplexPropertyTests.cs
@@ -2,7 +2,6 @@
using System.Text.Json.Protobuf.Tests;
using System.Text.Json.Serialization;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using SmartAnalyzers.ApprovalTestsExtensions;
using Xunit;
@@ -51,7 +50,7 @@ public void Should_deserialize_message_with_complex_property()
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.Equal(msg, deserialized);
}
[Fact]
@@ -74,6 +73,6 @@ public void Should_deserialize_message_with_complex_property_when_no_value_is_se
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.Equal(msg, deserialized);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/MessageWithDurationTests.cs b/test/Protobuf.System.Text.Json.Tests/MessageWithDurationTests.cs
index 64708ce..0c90420 100644
--- a/test/Protobuf.System.Text.Json.Tests/MessageWithDurationTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/MessageWithDurationTests.cs
@@ -2,7 +2,6 @@
using System.Text.Json.Protobuf.Tests;
using Google.Protobuf.WellKnownTypes;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using SmartAnalyzers.ApprovalTestsExtensions;
using Xunit;
@@ -60,8 +59,8 @@ public void Should_serialize_and_deserialize_message_with_duration()
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.NotNull(deserialized);
+ Assert.Equal(deserialized, msg);
}
[Fact]
@@ -76,8 +75,8 @@ public void Should_serialize_and_deserialize_message_with_duration_when_value_is
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.NotNull(deserialized);
+ Assert.Equal(deserialized, msg);
}
[Fact]
@@ -125,8 +124,7 @@ public void Should_deserialize_duration_property_from_complex_object_when_TreatD
var deserialized = JsonSerializer.Deserialize(payload, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.ShouldBeEquivalentTo(msg);
-
+ Assert.NotNull(deserialized);
+ Assert.Equal(deserialized, msg);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/MessageWithEnumFieldTests.cs b/test/Protobuf.System.Text.Json.Tests/MessageWithEnumFieldTests.cs
index 5ce93d6..e7cbcf3 100644
--- a/test/Protobuf.System.Text.Json.Tests/MessageWithEnumFieldTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/MessageWithEnumFieldTests.cs
@@ -1,7 +1,6 @@
using System.Text.Json;
using System.Text.Json.Protobuf.Tests;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using SmartAnalyzers.ApprovalTestsExtensions;
using Xunit;
@@ -42,8 +41,8 @@ public void Should_deserialize_message_with_with_enum_field()
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.NotNull(deserialized);
+ Assert.Equal(deserialized, msg);
}
[Fact]
@@ -106,8 +105,8 @@ public void Should_deserialize_message_with_enum_field_when_value_serialized_usi
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.NotNull(deserialized);
+ Assert.Equal(deserialized, msg);
}
[Fact]
@@ -127,6 +126,6 @@ public void Should_throw_exception_when_string_enum_value_cannot_be_deserialized
// Act & Assert
var exception = Assert.Throws(() => JsonSerializer.Deserialize(invalidPayload, jsonSerializerOptions));
- exception.Message.ShouldContain("'INVALID_OPTION' is not a valid value for type System.Text.Json.Protobuf.Tests.TestEnum.");
+ Assert.Contains("'INVALID_OPTION' is not a valid value for type System.Text.Json.Protobuf.Tests.TestEnum.", exception.Message);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/MessageWithMapsTests.cs b/test/Protobuf.System.Text.Json.Tests/MessageWithMapsTests.cs
index 3fbb86b..4c5831a 100644
--- a/test/Protobuf.System.Text.Json.Tests/MessageWithMapsTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/MessageWithMapsTests.cs
@@ -2,7 +2,6 @@
using System.Text.Json.Protobuf.Tests;
using Google.Protobuf;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using SmartAnalyzers.ApprovalTestsExtensions;
using Xunit;
@@ -59,7 +58,7 @@ public void Should_deserialize_message_with_map_field()
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.NotNull(deserialized);
+ Assert.Equal(deserialized, msg);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/MessageWithOneOfTests.cs b/test/Protobuf.System.Text.Json.Tests/MessageWithOneOfTests.cs
index 1893a28..8f83bb3 100644
--- a/test/Protobuf.System.Text.Json.Tests/MessageWithOneOfTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/MessageWithOneOfTests.cs
@@ -1,7 +1,6 @@
using System.Text.Json;
using System.Text.Json.Protobuf.Tests;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using SmartAnalyzers.ApprovalTestsExtensions;
using Xunit;
@@ -58,10 +57,10 @@ public void Should_serialize_and_deserialize_message_with_one_of_when_value_is_s
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.Int32PropertyValue.ShouldBe(msg.Int32PropertyValue);
- deserialized.Int64PropertyValue.ShouldBe(msg.Int64PropertyValue);
- deserialized.PropertyCase.ShouldBe(msg.PropertyCase);
+ Assert.NotNull(deserialized);
+ Assert.Equal(msg.Int32PropertyValue, deserialized.Int32PropertyValue);
+ Assert.Equal(msg.Int64PropertyValue, deserialized.Int64PropertyValue);
+ Assert.Equal(msg.PropertyCase, deserialized.PropertyCase);
}
[Fact]
@@ -76,10 +75,11 @@ public void Should_serialize_and_deserialize_message_with_one_of_when_value_is_n
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.Int32PropertyValue.ShouldBe(msg.Int32PropertyValue);
- deserialized.Int64PropertyValue.ShouldBe(msg.Int64PropertyValue);
- deserialized.PropertyCase.ShouldBe(msg.PropertyCase);
+ Assert.NotNull(deserialized);
+ Assert.Equal(msg.Int32PropertyValue, deserialized.Int32PropertyValue);
+ Assert.Equal(msg.Int64PropertyValue, deserialized.Int64PropertyValue);
+ Assert.Equal(msg.PropertyCase, deserialized.PropertyCase);
+
}
[Fact]
@@ -132,9 +132,9 @@ public void Should_serialize_and_deserialize_message_with_optional_property_when
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.Int32Property.ShouldBe(msg.Int32Property);
- deserialized.HasInt32Property.ShouldBe(msg.HasInt32Property);
+ Assert.NotNull(deserialized);
+ Assert.Equal(msg.Int32Property, deserialized.Int32Property);
+ Assert.Equal(msg.HasInt32Property, deserialized.HasInt32Property);
}
[Fact]
@@ -149,8 +149,8 @@ public void Should_serialize_and_deserialize_message_with_optional_property_when
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.Int32Property.ShouldBe(msg.Int32Property);
- deserialized.HasInt32Property.ShouldBe(msg.HasInt32Property);
+ Assert.NotNull(deserialized);
+ Assert.Equal(msg.Int32Property, deserialized.Int32Property);
+ Assert.Equal(msg.HasInt32Property, deserialized.HasInt32Property);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/MessageWithRepeatedListTests.cs b/test/Protobuf.System.Text.Json.Tests/MessageWithRepeatedListTests.cs
index 380328f..1bf39f9 100644
--- a/test/Protobuf.System.Text.Json.Tests/MessageWithRepeatedListTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/MessageWithRepeatedListTests.cs
@@ -1,7 +1,6 @@
using System.Text.Json;
using System.Text.Json.Protobuf.Tests;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using SmartAnalyzers.ApprovalTestsExtensions;
using Xunit;
@@ -62,11 +61,10 @@ public void Should_deserialize_message_with_repeated_list()
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
-
- deserialized.Int32List.ShouldBe(msg.Int32List);
- deserialized.Int64List.ShouldBe(msg.Int64List);
- deserialized.EnumList.ShouldBe(msg.EnumList);
- deserialized.NestedMessageList.ShouldBe(msg.NestedMessageList);
+ Assert.NotNull(deserialized);
+ Assert.Equal(msg.Int32List, deserialized.Int32List);
+ Assert.Equal(msg.Int64List, deserialized.Int64List);
+ Assert.Equal(msg.EnumList, deserialized.EnumList);
+ Assert.Equal(msg.NestedMessageList, deserialized.NestedMessageList);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/MessageWithTimestampTests.cs b/test/Protobuf.System.Text.Json.Tests/MessageWithTimestampTests.cs
index db3557e..b3e46bb 100644
--- a/test/Protobuf.System.Text.Json.Tests/MessageWithTimestampTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/MessageWithTimestampTests.cs
@@ -4,7 +4,6 @@
using System.Text.Json.Serialization;
using Google.Protobuf.WellKnownTypes;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using SmartAnalyzers.ApprovalTestsExtensions;
using Xunit;
@@ -62,8 +61,8 @@ public void Should_serialize_and_deserialize_message_with_timestamp()
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.NotNull(deserialized);
+ Assert.Equal(msg, deserialized);
}
[Fact]
@@ -78,8 +77,8 @@ public void Should_serialize_and_deserialize_message_with_timestamp_when_value_i
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.NotNull(deserialized);
+ Assert.Equal(deserialized, msg);
}
[Fact]
@@ -95,7 +94,7 @@ public void Should_serialize_and_deserialize_message_with_timestamp_when_value_i
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.ShouldBeEquivalentTo(msg);
+ Assert.NotNull(deserialized);
+ Assert.Equal(deserialized, msg);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/MessageWithWellKnownTypesTests.cs b/test/Protobuf.System.Text.Json.Tests/MessageWithWellKnownTypesTests.cs
index 6d55a6a..49a4084 100644
--- a/test/Protobuf.System.Text.Json.Tests/MessageWithWellKnownTypesTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/MessageWithWellKnownTypesTests.cs
@@ -2,7 +2,6 @@
using System.Text.Json.Protobuf.Tests;
using System.Text.Json.Serialization;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using SmartAnalyzers.ApprovalTestsExtensions;
using Xunit;
@@ -74,7 +73,8 @@ public void Should_serialize_and_deserialize_message_with_well_known_types_when_
// Assert
- deserialized.ShouldBe(msg);
+ Assert.Equal(msg, deserialized);
+
}
[Fact]
@@ -89,6 +89,6 @@ public void Should_serialize_and_deserialize_message_with_well_known_types_when_
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldBe(msg);
+ Assert.Equal(msg, deserialized);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/PropertyNameCaseInsensitiveTests.cs b/test/Protobuf.System.Text.Json.Tests/PropertyNameCaseInsensitiveTests.cs
index 764cfc3..266ebb0 100644
--- a/test/Protobuf.System.Text.Json.Tests/PropertyNameCaseInsensitiveTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/PropertyNameCaseInsensitiveTests.cs
@@ -1,6 +1,5 @@
using System.Text.Json;
using System.Text.Json.Protobuf.Tests;
-using Shouldly;
using Xunit;
namespace Protobuf.System.Text.Json.Tests;
@@ -30,6 +29,6 @@ public void Should_support_PropertyNameCaseInsensitive_setting()
var deserialized = JsonSerializer.Deserialize(payload, deserializerOptions);
- deserialized.ShouldBeEquivalentTo(originalMessage);
+ Assert.Equal(originalMessage, deserialized);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/Protobuf.System.Text.Json.Tests.csproj b/test/Protobuf.System.Text.Json.Tests/Protobuf.System.Text.Json.Tests.csproj
index 72421da..1747916 100644
--- a/test/Protobuf.System.Text.Json.Tests/Protobuf.System.Text.Json.Tests.csproj
+++ b/test/Protobuf.System.Text.Json.Tests/Protobuf.System.Text.Json.Tests.csproj
@@ -1,27 +1,26 @@
- net8.0
+ net9.0
enable
false
-
-
-
-
-
+
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
-
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
@@ -38,6 +37,4 @@
-
-
diff --git a/test/Protobuf.System.Text.Json.Tests/SchemaEvolutionTests.cs b/test/Protobuf.System.Text.Json.Tests/SchemaEvolutionTests.cs
index 33d4949..46ad0c8 100644
--- a/test/Protobuf.System.Text.Json.Tests/SchemaEvolutionTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/SchemaEvolutionTests.cs
@@ -1,12 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
+using System.IO;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Protobuf.Tests;
using System.Threading.Tasks;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using Xunit;
namespace Protobuf.System.Text.Json.Tests;
@@ -32,7 +29,8 @@ public void Should_be_able_to_deserialize_array_of_schema_v2_to_array_of_schema_
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldHaveSingleItem();
+ Assert.NotNull(deserialized);
+ Assert.Single(deserialized);
}
[Fact]
@@ -54,7 +52,7 @@ public async Task Should_be_able_to_deserialize_array_of_schema_v2_to_array_of_s
var deserialized = JsonSerializer.Deserialize(memoryStream, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.Length.ShouldBe(schemaEvolutionV2.Count);
+ Assert.NotNull(deserialized);
+ Assert.Equal(schemaEvolutionV2.Count, deserialized.Length);
}
}
\ No newline at end of file
diff --git a/test/Protobuf.System.Text.Json.Tests/SimpleMessageTests.cs b/test/Protobuf.System.Text.Json.Tests/SimpleMessageTests.cs
index 6899cf9..6490fa6 100644
--- a/test/Protobuf.System.Text.Json.Tests/SimpleMessageTests.cs
+++ b/test/Protobuf.System.Text.Json.Tests/SimpleMessageTests.cs
@@ -2,7 +2,6 @@
using System.Text.Json.Protobuf.Tests;
using Google.Protobuf;
using Protobuf.System.Text.Json.Tests.Utils;
-using Shouldly;
using SmartAnalyzers.ApprovalTestsExtensions;
using Xunit;
@@ -71,8 +70,8 @@ public void Should_deserialize_message_with_primitive_types()
var deserialized = JsonSerializer.Deserialize(serialized, jsonSerializerOptions);
// Assert
- deserialized.ShouldNotBeNull();
- deserialized.Int32Property.ShouldBe(msg.Int32Property);
- deserialized.Int64Property.ShouldBe(msg.Int64Property);
+ Assert.NotNull(deserialized);
+ Assert.Equal(msg.Int32Property, deserialized.Int32Property);
+ Assert.Equal(msg.Int64Property, deserialized.Int64Property);
}
}
\ No newline at end of file