22using FluentAssertions . Primitives ;
33using Microsoft . AspNetCore . Mvc ;
44using System ;
5+ using System . Diagnostics ;
56
67namespace FluentAssertions . AspNetCore . Mvc
78{
9+ /// <summary>
10+ /// Contains a number of methods to assert that a <see cref="JsonResult" /> is in the expected state.
11+ /// </summary>
12+ [ DebuggerNonUserCode ]
813 public class JsonResultAssertions : ObjectAssertions
914 {
1015 #region Public Constructors
1116
17+ /// <summary>
18+ /// Initializes a new instance of the <see cref="T:JsonResultAssertions" /> class.
19+ /// </summary>
20+ /// <param name="subject">The object to test assertion on</param>
1221 public JsonResultAssertions ( JsonResult subject ) : base ( subject )
1322 {
1423
@@ -18,6 +27,11 @@ public JsonResultAssertions(JsonResult subject) : base(subject)
1827
1928 #region Public Properties
2029
30+ /// <summary>
31+ /// The value on the JsonResult
32+ /// </summary>
33+ public object Value => JsonResultSubject . Value ;
34+
2135 #endregion
2236
2337 #region Private Properties
@@ -28,6 +42,18 @@ public JsonResultAssertions(JsonResult subject) : base(subject)
2842
2943 #region Public Methods
3044
45+ /// <summary>
46+ /// Asserts that the value is the expected value using Equals.
47+ /// </summary>
48+ /// <param name="expectedValue">The expected value.</param>
49+ /// <param name="reason">
50+ /// A formatted phrase as is supported by <see cref="string.Format(string,object[])" /> explaining why the assertion
51+ /// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
52+ /// </param>
53+ /// <param name="reasonArgs">
54+ /// Zero or more objects to format using the placeholders in <see cref="reason" />.
55+ /// </param>
56+ /// <returns></returns>
3157 public JsonResultAssertions WithValue ( object expectedValue , string reason = "" ,
3258 params object [ ] reasonArgs )
3359 {
0 commit comments