Skip to content

Commit e761833

Browse files
committed
refactor: removes unnecessary exception message assertions
These messages differ between .NET Framework, .NET Standard and .NET 8, making them tedious to test. The messages themselves are superfluous and unnecessary for what we're doing, so the assertions have been removed.
1 parent b7c0414 commit e761833

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ShopifySharp.Tests/Infrastructure/Serialization/Json/SystemJsonSerializerTests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ public void Deserialize_WhenTheNodeIsNotASystemTextJsonNode_ShouldThrow()
218218
// Assert
219219
act.Should()
220220
.Throw<ArgumentException>()
221-
.WithMessage($"Expected a {nameof(SystemJsonElement)} but got *. (Parameter 'element')")
222221
.And
223222
.ParamName
224223
.Should()
@@ -305,7 +304,6 @@ public void Deserialize_T_WhenTheNodeIsNotASystemTextJsonNode_ShouldThrow()
305304
// Assert
306305
act.Should()
307306
.Throw<ArgumentException>()
308-
.WithMessage($"Expected a {nameof(SystemJsonElement)} but got *. (Parameter 'element')")
309307
.And
310308
.ParamName
311309
.Should()
@@ -378,8 +376,7 @@ public async Task DeserializeAsync_WhenTheNodeIsNotASystemTextJsonNode_ShouldThr
378376

379377
// Assert
380378
var exn = await act.Should()
381-
.ThrowAsync<ArgumentException>()
382-
.WithMessage($"Expected a {nameof(SystemJsonElement)} but got *. (Parameter 'element')");
379+
.ThrowAsync<ArgumentException>();
383380
exn.And.ParamName.Should().Be("element");
384381
}
385382

@@ -458,8 +455,7 @@ public async Task DeserializeAsync_T_WhenTheNodeIsNotASystemTextJsonNode_ShouldT
458455

459456
// Assert
460457
var exn = await act.Should()
461-
.ThrowAsync<ArgumentException>()
462-
.WithMessage($"Expected a {nameof(SystemJsonElement)} but got *. (Parameter 'element')");
458+
.ThrowAsync<ArgumentException>();
463459
exn.And.ParamName.Should().Be("element");
464460
}
465461

0 commit comments

Comments
 (0)