1- using FluentAssertions ;
2- using Kros . KORM . Converter ;
1+ using Kros . KORM . Converter ;
32using System ;
43using System . Text . Json ;
54using System . Text . RegularExpressions ;
@@ -12,9 +11,7 @@ public class JsonConverterShould
1211 [ Fact ]
1312 public void ThrowArgumentExceptionWhenSerializationOptionsAreNull ( )
1413 {
15- Action action = ( ) => new JsonConverter < TestClass > ( null ) ;
16-
17- action . Should ( ) . Throw < ArgumentException > ( ) ;
14+ Assert . Throws < ArgumentNullException > ( ( ) => new JsonConverter < TestClass > ( null ) ) ;
1815 }
1916
2017 [ Fact ]
@@ -25,8 +22,8 @@ public void ConvertJsonToEntity()
2522 TestClass expected = GetSampleClass ( ) ;
2623 var actual = converter . Convert ( GetSampleJson ( ) ) ;
2724
28- actual . Should ( ) . BeOfType < TestClass > ( ) ;
29- ( ( TestClass ) actual ) . Should ( ) . BeEquivalentTo ( expected ) ;
25+ var typedActual = Assert . IsType < TestClass > ( actual ) ;
26+ Assert . Equivalent ( expected , typedActual , strict : true ) ;
3027 }
3128
3229 [ Fact ]
@@ -36,7 +33,7 @@ public void ThrowJsonExceptionWhenTryingToConvertImproperlyFormattedJsonToEntity
3633
3734 Action action = ( ) => converter . Convert ( GetSampleImproperlyFormattedJson ( ) ) ;
3835
39- action . Should ( ) . Throw < JsonException > ( ) ;
36+ Assert . Throws < JsonException > ( action ) ;
4037 }
4138
4239 [ Fact ]
@@ -51,8 +48,8 @@ public void ConvertImproperlyFormattedJsonToEntityWhenUsingCorrectOptions()
5148 TestClass expected = GetSampleClass ( ) ;
5249 var actual = converter . Convert ( GetSampleImproperlyFormattedJson ( ) ) ;
5350
54- actual . Should ( ) . BeOfType < TestClass > ( ) ;
55- ( ( TestClass ) actual ) . Should ( ) . BeEquivalentTo ( expected ) ;
51+ var typedActual = Assert . IsType < TestClass > ( actual ) ;
52+ Assert . Equivalent ( expected , typedActual , strict : true ) ;
5653 }
5754
5855 [ Fact ]
@@ -63,11 +60,11 @@ public void ConvertEntityToJson()
6360 string expected = GetSampleJson ( ) ;
6461 var actual = converter . ConvertBack ( GetSampleClass ( ) ) ;
6562
66- actual . Should ( ) . BeOfType < string > ( ) ;
67- ( ( string ) actual ) . Should ( ) . Be ( expected ) ;
63+ var typedActual = Assert . IsType < string > ( actual ) ;
64+ Assert . Equal ( expected , typedActual ) ;
6865 }
6966
70- private TestClass GetSampleClass ( )
67+ private static TestClass GetSampleClass ( )
7168 => new TestClass ( )
7269 {
7370 BoolProperty = true ,
@@ -77,7 +74,7 @@ private TestClass GetSampleClass()
7774 ObjectProperty = new TestClass ( ) { StringProperty = "DolorSitAmet" }
7875 } ;
7976
80- private string GetSampleJson ( )
77+ private static string GetSampleJson ( )
8178 => Regex . Replace (
8279 @"{
8380 ""BoolProperty"":true,
@@ -94,7 +91,7 @@ private string GetSampleJson()
9491 }
9592 }" , @"\s+" , "" ) ;
9693
97- private string GetSampleImproperlyFormattedJson ( )
94+ private static string GetSampleImproperlyFormattedJson ( )
9895 => Regex . Replace (
9996 @"{
10097 ""boolProperty"":true,
0 commit comments