@@ -43,26 +43,25 @@ public JsonResultAssertions(JsonResult subject) : base(subject)
43
43
#region Public Methods
44
44
45
45
/// <summary>
46
- /// Asserts that the value is the expected value using Equals .
46
+ /// Asserts that the content type is the expected content type .
47
47
/// </summary>
48
- /// <param name="expectedValue ">The expected value .</param>
48
+ /// <param name="expectedContentType ">The expected content type .</param>
49
49
/// <param name="reason">
50
50
/// A formatted phrase as is supported by <see cref="string.Format(string,object[])" /> explaining why the assertion
51
51
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
52
52
/// </param>
53
53
/// <param name="reasonArgs">
54
54
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
55
55
/// </param>
56
- /// <returns></returns>
57
- public JsonResultAssertions WithValue ( object expectedValue , string reason = "" ,
56
+ public JsonResultAssertions WithContentType ( string expectedContentType , string reason = "" ,
58
57
params object [ ] reasonArgs )
59
58
{
60
- var actualValue = JsonResultSubject . Value ;
59
+ var actualContentType = JsonResultSubject . ContentType ;
61
60
62
61
Execute . Assertion
63
- . ForCondition ( Equals ( expectedValue , actualValue ) )
62
+ . ForCondition ( string . Equals ( expectedContentType , actualContentType , StringComparison . OrdinalIgnoreCase ) )
64
63
. BecauseOf ( reason , reasonArgs )
65
- . FailWith ( FailureMessages . CommonFailMessage , "JsonResult.Value " , expectedValue , actualValue ) ;
64
+ . FailWith ( FailureMessages . CommonFailMessage , "JsonResult.ContentType " , expectedContentType , actualContentType ) ;
66
65
return this ;
67
66
}
68
67
0 commit comments