11using System ;
22using System . Collections . Generic ;
3- using FluentAssertions ;
3+ using Shouldly ;
44using Xunit ;
55
66namespace Extensions . Tests
@@ -12,7 +12,7 @@ public class GenericExtensionsTests
1212 [ InlineData ( false , false ) ]
1313 public void BoolShouldResolveAsBool ( bool value , bool expected )
1414 {
15- value . ToBool ( ) . Should ( ) . Be ( expected ) ;
15+ value . ToBool ( ) . ShouldBe ( expected ) ;
1616 }
1717
1818 [ Theory ]
@@ -22,7 +22,7 @@ public void BoolShouldResolveAsBool(bool value, bool expected)
2222 [ InlineData ( - 7 , true ) ]
2323 public void IntShouldResolveAsBool ( int ? value , bool expected )
2424 {
25- value . ToBool ( ) . Should ( ) . Be ( expected ) ;
25+ value . ToBool ( ) . ShouldBe ( expected ) ;
2626 }
2727
2828 [ Theory ]
@@ -32,7 +32,7 @@ public void IntShouldResolveAsBool(int? value, bool expected)
3232 [ InlineData ( "asd" , false ) ]
3333 public void StringShouldResolveAsBool ( string value , bool expected )
3434 {
35- value . ToBool ( ) . Should ( ) . Be ( expected ) ;
35+ value . ToBool ( ) . ShouldBe ( expected ) ;
3636 }
3737
3838 [ Theory ]
@@ -42,7 +42,7 @@ public void StringShouldResolveAsBool(string value, bool expected)
4242 [ InlineData ( - 7f , true ) ]
4343 public void FloatShouldResolveAsBool ( float ? value , bool expected )
4444 {
45- value . ToBool ( ) . Should ( ) . Be ( expected ) ;
45+ value . ToBool ( ) . ShouldBe ( expected ) ;
4646 }
4747
4848 [ Theory ]
@@ -52,37 +52,37 @@ public void FloatShouldResolveAsBool(float? value, bool expected)
5252 [ InlineData ( - 7.0 , true ) ]
5353 public void DoubleShouldResolveAsBool ( double ? value , bool expected )
5454 {
55- value . ToBool ( ) . Should ( ) . Be ( expected ) ;
55+ value . ToBool ( ) . ShouldBe ( expected ) ;
5656 }
5757
5858 [ Fact ]
5959 public void ObjectShouldResolveAsTrue ( )
6060 {
61- new { Id = 7 } . ToBool ( ) . Should ( ) . BeTrue ( ) ;
61+ new { Id = 7 } . ToBool ( ) . ShouldBeTrue ( ) ;
6262 }
6363
6464 [ Fact ]
6565 public void NullShouldResolveAsFlase ( )
6666 {
6767 object value = null ;
6868
69- value . ToBool ( ) . Should ( ) . BeFalse ( ) ;
69+ value . ToBool ( ) . ShouldBeFalse ( ) ;
7070 }
7171
7272 [ Theory ]
7373 [ InlineData ( 'b' , "abcd" , true ) ]
7474 [ InlineData ( 'f' , "abcd" , false ) ]
7575 public void ShouldCheckIfValueIsInString ( char value , string fullString , bool expected )
7676 {
77- value . IsIn ( fullString ) . Should ( ) . Be ( expected ) ;
77+ value . IsIn ( fullString ) . ShouldBe ( expected ) ;
7878 }
7979
8080 [ Theory ]
8181 [ InlineData ( 'b' , "abcd" , false ) ]
8282 [ InlineData ( 'f' , "abcd" , true ) ]
8383 public void ShouldCheckIfValueIsNotInString ( char value , string fullString , bool expected )
8484 {
85- value . IsNotIn ( fullString ) . Should ( ) . Be ( expected ) ;
85+ value . IsNotIn ( fullString ) . ShouldBe ( expected ) ;
8686 }
8787
8888 [ Fact ]
@@ -91,8 +91,8 @@ public void ShouldCheckIfStringIsInStrings()
9191 var value = "test" ;
9292 var strings = new List < string > { "this" , "is" , "a" , "test" } ;
9393
94- value . IsIn ( strings ) . Should ( ) . BeTrue ( ) ;
95- value . IsNotIn ( strings ) . Should ( ) . BeFalse ( ) ;
94+ value . IsIn ( strings ) . ShouldBeTrue ( ) ;
95+ value . IsNotIn ( strings ) . ShouldBeFalse ( ) ;
9696 }
9797
9898 [ Fact ]
@@ -101,8 +101,8 @@ public void ShouldCheckIfStringIsNotInStrings()
101101 var value = "not" ;
102102 var strings = new List < string > { "this" , "is" , "a" , "test" } ;
103103
104- value . IsIn ( strings ) . Should ( ) . BeFalse ( ) ;
105- value . IsNotIn ( strings ) . Should ( ) . BeTrue ( ) ;
104+ value . IsIn ( strings ) . ShouldBeFalse ( ) ;
105+ value . IsNotIn ( strings ) . ShouldBeTrue ( ) ;
106106 }
107107
108108 [ Fact ]
@@ -117,7 +117,9 @@ public void ShouldCastFromAnonymousObject()
117117
118118 var casted = anon . AnonymousCastTo < TestClass > ( ) ;
119119
120- casted . Should ( ) . BeEquivalentTo ( anon ) ;
120+ casted . Id . ShouldBe ( anon . Id ) ;
121+ casted . Description . ShouldBe ( anon . Description ) ;
122+ casted . TimeStamp . ShouldBe ( anon . TimeStamp ) ;
121123 }
122124
123125 [ Fact ]
@@ -132,7 +134,7 @@ public void ShouldClone()
132134
133135 var b = a . Clone ( ) ;
134136
135- b . Should ( ) . BeEquivalentTo ( a ) ;
137+ b . ShouldBeEquivalentTo ( a ) ;
136138 }
137139
138140 [ Theory ]
@@ -143,7 +145,7 @@ public void ShouldClone()
143145 [ InlineData ( "asd" , "asd" , true ) ]
144146 public void ShouldReturnEqual ( object a , object b , bool expected )
145147 {
146- a . IsEqualTo ( b ) . Should ( ) . Be ( expected ) ;
148+ a . IsEqualTo ( b ) . ShouldBe ( expected ) ;
147149 }
148150
149151 private class TestClass
0 commit comments