2
2
using FluentAssertions . Primitives ;
3
3
using Microsoft . AspNetCore . Mvc ;
4
4
using System ;
5
+ using System . Diagnostics ;
5
6
6
7
namespace FluentAssertions . AspNetCore . Mvc
7
8
{
9
+ /// <summary>
10
+ /// Contains a number of methods to assert that a <see cref="JsonResult" /> is in the expected state.
11
+ /// </summary>
12
+ [ DebuggerNonUserCode ]
8
13
public class JsonResultAssertions : ObjectAssertions
9
14
{
10
15
#region Public Constructors
11
16
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>
12
21
public JsonResultAssertions ( JsonResult subject ) : base ( subject )
13
22
{
14
23
@@ -18,6 +27,11 @@ public JsonResultAssertions(JsonResult subject) : base(subject)
18
27
19
28
#region Public Properties
20
29
30
+ /// <summary>
31
+ /// The value on the JsonResult
32
+ /// </summary>
33
+ public object Value => JsonResultSubject . Value ;
34
+
21
35
#endregion
22
36
23
37
#region Private Properties
@@ -28,6 +42,18 @@ public JsonResultAssertions(JsonResult subject) : base(subject)
28
42
29
43
#region Public Methods
30
44
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>
31
57
public JsonResultAssertions WithValue ( object expectedValue , string reason = "" ,
32
58
params object [ ] reasonArgs )
33
59
{
0 commit comments