8
8
9
9
namespace FluentAssertions . Mvc
10
10
{
11
+ /// <summary>
12
+ /// Contains a number of methods to assert that a <see cref="RedirectResult"/> is in the expected state.
13
+ /// </summary>
11
14
public class RedirectResultAssertions : ObjectAssertions
12
15
{
16
+ /// <summary>
17
+ /// Initializes a new instance of the <see cref="T:RedirectResultAssertions" /> class.
18
+ /// </summary>
13
19
public RedirectResultAssertions ( RedirectResult subject ) : base ( subject ) { }
14
20
15
- public RedirectResultAssertions WithUrl ( string expectedUrl )
16
- {
17
- WithUrl ( expectedUrl , string . Empty , null ) ;
18
- return this ;
19
- }
20
-
21
- public RedirectResultAssertions WithUrl ( string expectedUrl , string reason , string reasonArgs )
21
+ /// <summary>
22
+ /// Asserts that the url is the expected url.
23
+ /// </summary>
24
+ /// <param name="expectedUrl">The expected url.</param>
25
+ /// <param name="reason">
26
+ /// A formatted phrase as is supported by <see cref="string.Format(string,object[])" /> explaining why the assertion
27
+ /// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
28
+ /// </param>
29
+ /// <param name="reasonArgs">
30
+ /// Zero or more objects to format using the placeholders in <see cref="reason" />.
31
+ /// </param>
32
+ public RedirectResultAssertions WithUrl ( string expectedUrl , string reason = "" , params object [ ] reasonArgs )
22
33
{
23
34
string actualUrl = ( Subject as RedirectResult ) . Url ;
24
35
@@ -30,13 +41,18 @@ public RedirectResultAssertions WithUrl(string expectedUrl, string reason, strin
30
41
return this ;
31
42
}
32
43
33
- public RedirectResultAssertions WithPermanent ( bool expectedPermanent )
34
- {
35
- WithPermanent ( expectedPermanent , string . Empty , null ) ;
36
- return this ;
37
- }
38
-
39
- public RedirectResultAssertions WithPermanent ( bool expectedPermanent , string reason , string reasonArgs )
44
+ /// <summary>
45
+ /// Asserts that the redirect is permanent.
46
+ /// </summary>
47
+ /// <param name="expectedPermanent">Should the expected redirect be permanent.</param>
48
+ /// <param name="reason">
49
+ /// A formatted phrase as is supported by <see cref="string.Format(string,object[])" /> explaining why the assertion
50
+ /// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
51
+ /// </param>
52
+ /// <param name="reasonArgs">
53
+ /// Zero or more objects to format using the placeholders in <see cref="reason" />.
54
+ /// </param>
55
+ public RedirectResultAssertions WithPermanent ( bool expectedPermanent , string reason = "" , params object [ ] reasonArgs )
40
56
{
41
57
bool actualPermanent = ( Subject as RedirectResult ) . Permanent ;
42
58
0 commit comments