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/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