1111namespace FluentAssertions . Mvc
1212{
1313 [ DebuggerNonUserCode ]
14+ /// <summary>
15+ /// Contains a number of methods to assert that a <see cref="RouteData"/> is in the expected state.
16+ /// </summary>
1417 public class RouteDataAssertions : ObjectAssertions
1518 {
19+ /// <summary>
20+ /// Initializes a new instance of the <see cref="T:RouteDataAssertions" /> class.
21+ /// </summary>
1622 public RouteDataAssertions ( RouteData subject )
1723 : base ( subject )
1824 {
1925 Subject = subject ;
2026 }
2127
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 )
2940 {
3041 HaveValue ( "controller" , expectedControllerName , reason , reasonArgs ) ;
3142 return this ;
3243 }
3344
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 )
4157 {
4258 HaveValue ( "action" , expectedActionName , reason , reasonArgs ) ;
4359 return this ;
4460 }
4561
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 )
5375 {
5476 var subjectTyped = Subject as RouteData ;
5577
@@ -68,13 +90,19 @@ public RouteDataAssertions HaveDataToken(string key, object expectedValue, strin
6890 return this ;
6991 }
7092
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 )
78106 {
79107 var subjectTyped = Subject as RouteData ;
80108
0 commit comments