11
11
namespace FluentAssertions . Mvc
12
12
{
13
13
[ DebuggerNonUserCode ]
14
+ /// <summary>
15
+ /// Contains a number of methods to assert that a <see cref="RouteData"/> is in the expected state.
16
+ /// </summary>
14
17
public class RouteDataAssertions : ObjectAssertions
15
18
{
19
+ /// <summary>
20
+ /// Initializes a new instance of the <see cref="T:RouteDataAssertions" /> class.
21
+ /// </summary>
16
22
public RouteDataAssertions ( RouteData subject )
17
23
: base ( subject )
18
24
{
19
25
Subject = subject ;
20
26
}
21
27
22
- public RouteDataAssertions HaveController ( string expectedControllerName )
23
- {
24
- HaveController ( expectedControllerName , string . Empty , null ) ;
25
- return this ;
26
- }
27
-
28
- public RouteDataAssertions HaveController ( string expectedControllerName , string reason , params object [ ] reasonArgs )
28
+ /// <summary>
29
+ /// Asserts that the route data has the expected controller name.
30
+ /// </summary>
31
+ /// <param name="expectedControllerName">The expected controller name.</param>
32
+ /// <param name="reason">
33
+ /// A formatted phrase as is supported by <see cref="string.Format(string,object[])" /> explaining why the assertion
34
+ /// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
35
+ /// </param>
36
+ /// <param name="reasonArgs">
37
+ /// Zero or more objects to format using the placeholders in <see cref="reason" />.
38
+ /// </param>
39
+ public RouteDataAssertions HaveController ( string expectedControllerName , string reason = "" , params object [ ] reasonArgs )
29
40
{
30
41
HaveValue ( "controller" , expectedControllerName , reason , reasonArgs ) ;
31
42
return this ;
32
43
}
33
44
34
- public RouteDataAssertions HaveAction ( string expectedActionName )
35
- {
36
- HaveAction ( expectedActionName , string . Empty , null ) ;
37
- return this ;
38
- }
39
-
40
- public RouteDataAssertions HaveAction ( string expectedActionName , string reason , params object [ ] reasonArgs )
45
+ /// <summary>
46
+ /// Asserts that the route data has the expected action name.
47
+ /// </summary>
48
+ /// <param name="expectedActionName">The expected action name.</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
+ public RouteDataAssertions HaveAction ( string expectedActionName , string reason = "" , params object [ ] reasonArgs )
41
57
{
42
58
HaveValue ( "action" , expectedActionName , reason , reasonArgs ) ;
43
59
return this ;
44
60
}
45
61
46
- public RouteDataAssertions HaveDataToken ( string key , object expectedValue )
47
- {
48
- HaveDataToken ( key , expectedValue , string . Empty , null ) ;
49
- return this ;
50
- }
51
-
52
- public RouteDataAssertions HaveDataToken ( string key , object expectedValue , string reason , params object [ ] reasonArgs )
62
+ /// <summary>
63
+ /// Asserts that the route data has the expected data token.
64
+ /// </summary>
65
+ /// <param name="key">The expected data token key value.</param>
66
+ /// <param name="expectedValue">The expected data token value.</param>
67
+ /// <param name="reason">
68
+ /// A formatted phrase as is supported by <see cref="string.Format(string,object[])" /> explaining why the assertion
69
+ /// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
70
+ /// </param>
71
+ /// <param name="reasonArgs">
72
+ /// Zero or more objects to format using the placeholders in <see cref="reason" />.
73
+ /// </param>
74
+ public RouteDataAssertions HaveDataToken ( string key , object expectedValue , string reason = "" , params object [ ] reasonArgs )
53
75
{
54
76
var subjectTyped = Subject as RouteData ;
55
77
@@ -68,13 +90,19 @@ public RouteDataAssertions HaveDataToken(string key, object expectedValue, strin
68
90
return this ;
69
91
}
70
92
71
- public RouteDataAssertions HaveValue ( string key , object expectedValue )
72
- {
73
- HaveValue ( key , expectedValue , string . Empty , null ) ;
74
- return this ;
75
- }
76
-
77
- public RouteDataAssertions HaveValue ( string key , object expectedValue , string reason , params object [ ] reasonArgs )
93
+ /// <summary>
94
+ /// Asserts that the route data has the expected value.
95
+ /// </summary>
96
+ /// <param name="key">The expected key.</param>
97
+ /// <param name="expectedValue">The expected value.</param>
98
+ /// <param name="reason">
99
+ /// A formatted phrase as is supported by <see cref="string.Format(string,object[])" /> explaining why the assertion
100
+ /// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
101
+ /// </param>
102
+ /// <param name="reasonArgs">
103
+ /// Zero or more objects to format using the placeholders in <see cref="reason" />.
104
+ /// </param>
105
+ public RouteDataAssertions HaveValue ( string key , object expectedValue , string reason = "" , params object [ ] reasonArgs )
78
106
{
79
107
var subjectTyped = Subject as RouteData ;
80
108
0 commit comments