11using FluentAssertions . Execution ;
22using FluentAssertions . Primitives ;
33using System ;
4- using System . Collections . Generic ;
5- using System . Linq ;
64using System . Text ;
7- #if NETSTANDARD1_6
8- using Microsoft . AspNetCore . Mvc ;
9- #else
105using System . Web . Mvc ;
11- #endif
126
137namespace FluentAssertions . Mvc
148{
@@ -40,13 +34,9 @@ public ContentResultAssertions WithContent(string expectedContent, string reason
4034 string actualContent = ( Subject as ContentResult ) . Content ;
4135
4236 Execute . Assertion
43- #if NETSTANDARD1_6
44- . ForCondition ( string . Equals ( actualContent , expectedContent , StringComparison . OrdinalIgnoreCase ) )
45- #else
46- . ForCondition ( string . Equals ( actualContent , expectedContent , StringComparison . InvariantCultureIgnoreCase ) )
47- #endif
48- . BecauseOf ( reason , reasonArgs )
49- . FailWith ( string . Format ( FailureMessages . CommonFailMessage , "ContentResult.Content" , expectedContent , actualContent ) ) ;
37+ . ForCondition ( string . Equals ( actualContent , expectedContent , StringComparison . InvariantCultureIgnoreCase ) )
38+ . BecauseOf ( reason , reasonArgs )
39+ . FailWith ( string . Format ( FailureMessages . CommonFailMessage , "ContentResult.Content" , expectedContent , actualContent ) ) ;
5040
5141 return this ;
5242 }
@@ -67,19 +57,13 @@ public ContentResultAssertions WithContentType(string expectedContentType, strin
6757 string actualContentType = ( Subject as ContentResult ) . ContentType ;
6858
6959 Execute . Assertion
70- #if NETSTANDARD1_6
71- . ForCondition ( string . Equals ( expectedContentType , actualContentType , StringComparison . OrdinalIgnoreCase ) )
72- #else
73- . ForCondition ( string . Equals ( expectedContentType , actualContentType , StringComparison . InvariantCultureIgnoreCase ) )
74- #endif
75- . BecauseOf ( reason , reasonArgs )
76- . FailWith ( string . Format ( FailureMessages . CommonFailMessage , "ContentResult.ContentType" , expectedContentType , actualContentType ) ) ;
60+ . ForCondition ( string . Equals ( expectedContentType , actualContentType , StringComparison . InvariantCultureIgnoreCase ) )
61+ . BecauseOf ( reason , reasonArgs )
62+ . FailWith ( string . Format ( FailureMessages . CommonFailMessage , "ContentResult.ContentType" , expectedContentType , actualContentType ) ) ;
7763
7864 return this ;
7965 }
8066
81- // ContentEncoding seems to have vanished from .NetCore... weird.
82- #if ! NETSTANDARD1_6
8367 /// <summary>
8468 /// Asserts that the content encoding is the expected content encoding type.
8569 /// </summary>
@@ -102,6 +86,5 @@ public ContentResultAssertions WithContentEncoding(Encoding expectedEncoding, st
10286
10387 return this ;
10488 }
105- #endif
10689 }
10790}
0 commit comments