@@ -43,26 +43,25 @@ public JsonResultAssertions(JsonResult subject) : base(subject)
4343 #region Public Methods
4444
4545 /// <summary>
46- /// Asserts that the value is the expected value using Equals .
46+ /// Asserts that the content type is the expected content type .
4747 /// </summary>
48- /// <param name="expectedValue ">The expected value .</param>
48+ /// <param name="expectedContentType ">The expected content type .</param>
4949 /// <param name="reason">
5050 /// A formatted phrase as is supported by <see cref="string.Format(string,object[])" /> explaining why the assertion
5151 /// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
5252 /// </param>
5353 /// <param name="reasonArgs">
5454 /// Zero or more objects to format using the placeholders in <see cref="reason" />.
5555 /// </param>
56- /// <returns></returns>
57- public JsonResultAssertions WithValue ( object expectedValue , string reason = "" ,
56+ public JsonResultAssertions WithContentType ( string expectedContentType , string reason = "" ,
5857 params object [ ] reasonArgs )
5958 {
60- var actualValue = JsonResultSubject . Value ;
59+ var actualContentType = JsonResultSubject . ContentType ;
6160
6261 Execute . Assertion
63- . ForCondition ( Equals ( expectedValue , actualValue ) )
62+ . ForCondition ( string . Equals ( expectedContentType , actualContentType , StringComparison . OrdinalIgnoreCase ) )
6463 . BecauseOf ( reason , reasonArgs )
65- . FailWith ( FailureMessages . CommonFailMessage , "JsonResult.Value " , expectedValue , actualValue ) ;
64+ . FailWith ( FailureMessages . CommonFailMessage , "JsonResult.ContentType " , expectedContentType , actualContentType ) ;
6665 return this ;
6766 }
6867
0 commit comments