Skip to content

Commit feb27c2

Browse files
rikrakkevinkuszyk
authored andcommitted
Fixed up missing comments
1 parent ae40b80 commit feb27c2

14 files changed

+91
-27
lines changed

src/FluentAssertions.Mvc.Shared/ActionResultAssertions.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ namespace FluentAssertions.Mvc
1616
[DebuggerNonUserCode]
1717
public class ActionResultAssertions : ObjectAssertions
1818
{
19+
/// <summary>
20+
/// Contains fixed values used in assertions
21+
/// </summary>
1922
public struct Constants
2023
{
24+
/// <summary>
25+
/// A shared failure message
26+
/// </summary>
2127
public const string CommonFailMessage = "Expected ActionResult to be {0}{reason}, but found {1}";
2228
}
2329

@@ -52,7 +58,7 @@ public ContentResultAssertions BeContentResult()
5258
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
5359
/// </param>
5460
/// <param name="reasonArgs">
55-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
61+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
5662
/// </param>
5763
public ContentResultAssertions BeContentResult(string reason, params object[] reasonArgs)
5864
{
@@ -80,7 +86,7 @@ public EmptyResult BeEmptyResult()
8086
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
8187
/// </param>
8288
/// <param name="reasonArgs">
83-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
89+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
8490
/// </param>
8591
public EmptyResult BeEmptyResult(string reason, params object[] reasonArgs)
8692
{
@@ -108,7 +114,7 @@ public RedirectToRouteAssertions BeRedirectToRouteResult()
108114
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
109115
/// </param>
110116
/// <param name="reasonArgs">
111-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
117+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
112118
/// </param>
113119
public RedirectToRouteAssertions BeRedirectToRouteResult(string reason, params object[] reasonArgs)
114120
{
@@ -136,7 +142,7 @@ public PartialViewResultAssertions BePartialViewResult()
136142
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
137143
/// </param>
138144
/// <param name="reasonArgs">
139-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
145+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
140146
/// </param>
141147
public PartialViewResultAssertions BePartialViewResult(string reason, params object[] reasonArgs)
142148
{
@@ -164,7 +170,7 @@ public RedirectResultAssertions BeRedirectResult()
164170
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
165171
/// </param>
166172
/// <param name="reasonArgs">
167-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
173+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
168174
/// </param>
169175
public RedirectResultAssertions BeRedirectResult(string reason, params object[] reasonArgs)
170176
{
@@ -192,7 +198,7 @@ public ViewResultAssertions BeViewResult()
192198
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
193199
/// </param>
194200
/// <param name="reasonArgs">
195-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
201+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
196202
/// </param>
197203
public ViewResultAssertions BeViewResult(string reason, params object[] reasonArgs)
198204
{

src/FluentAssertions.Mvc.Shared/ContentResultAssertions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public ContentResultAssertions(ContentResult subject) : base(subject)
3333
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
3434
/// </param>
3535
/// <param name="reasonArgs">
36-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
36+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
3737
/// </param>
3838
public ContentResultAssertions WithContent(string expectedContent, string reason = "", params object[] reasonArgs)
3939
{
@@ -60,7 +60,7 @@ public ContentResultAssertions WithContent(string expectedContent, string reason
6060
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
6161
/// </param>
6262
/// <param name="reasonArgs">
63-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
63+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
6464
/// </param>
6565
public ContentResultAssertions WithContentType(string expectedContentType, string reason = "", params object[] reasonArgs)
6666
{
@@ -89,7 +89,7 @@ public ContentResultAssertions WithContentType(string expectedContentType, strin
8989
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
9090
/// </param>
9191
/// <param name="reasonArgs">
92-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
92+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
9393
/// </param>
9494
public ContentResultAssertions WithContentEncoding(Encoding expectedEncoding, string reason = "", params object[] reasonArgs)
9595
{

src/FluentAssertions.Mvc.Shared/ControllerAssertions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33

44
namespace FluentAssertions.Mvc
55
{
6+
/// <summary>
7+
/// Container for methods that assert that a <see cref="System.Web.Mvc.ControllerBase"/> is in the expected state.
8+
/// </summary>
69
[DebuggerNonUserCode]
710
public class ControllerAssertions
811
{
12+
/// <summary>
13+
/// Creates a new instance of <see cref="ControllerAssertions"/>
14+
/// </summary>
915
public ControllerAssertions ()
1016
{
1117
}

src/FluentAssertions.Mvc.Shared/Fakes/FakeHttpContext.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@
44

55
namespace FluentAssertions.Mvc.Fakes
66
{
7+
/// <summary>
8+
/// Mimics a <see cref="HttpContextBase"/>. For use in testing.
9+
/// </summary>
710
public class FakeHttpContext : HttpContextBase
811
{
912
private FakeHttpRequest _request;
1013
private FakeHttpResponse _response;
1114

15+
/// <summary>
16+
/// Creates a new instance of <see cref="FakeHttpContext"/>
17+
/// </summary>
18+
/// <param name="appPath"></param>
19+
/// <param name="relativeUrl"></param>
1220
public FakeHttpContext(string appPath, string relativeUrl)
1321
{
1422
_request = new FakeHttpRequest(appPath, relativeUrl);
1523
_response = new FakeHttpResponse();
1624
}
1725

26+
/// <inheritdoc />
1827
public override HttpRequestBase Request
1928
{
2029
get
@@ -23,6 +32,7 @@ public override HttpRequestBase Request
2332
}
2433
}
2534

35+
/// <inheritdoc />
2636
public override HttpResponseBase Response
2737
{
2838
get
@@ -31,6 +41,7 @@ public override HttpResponseBase Response
3141
}
3242
}
3343

44+
/// <inheritdoc />
3445
public override object GetService(Type serviceType)
3546
{
3647
return new FakeHttpWorkerRequest();

src/FluentAssertions.Mvc.Shared/Fakes/FakeHttpRequest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@
44

55
namespace FluentAssertions.Mvc.Fakes
66
{
7+
/// <summary>
8+
/// Mimics a <see cref="HttpRequestBase"/>. Used for testing
9+
/// </summary>
710
public class FakeHttpRequest : HttpRequestBase
811
{
912
private string _appRelativePath;
1013
private string _appPath;
1114

15+
/// <summary>
16+
/// Creates a new instance of <see cref="FakeHttpRequest"/>
17+
/// </summary>
18+
/// <param name="appPath"></param>
19+
/// <param name="relativePath"></param>
1220
public FakeHttpRequest(string appPath, string relativePath)
1321
{
1422
_appPath = appPath;
@@ -26,6 +34,7 @@ private string fixRelativeUrl(string url)
2634
return url;
2735
}
2836

37+
/// <inheritdoc />
2938
public override string ApplicationPath
3039
{
3140
get
@@ -34,6 +43,7 @@ public override string ApplicationPath
3443
}
3544
}
3645

46+
/// <inheritdoc />
3747
public override string AppRelativeCurrentExecutionFilePath
3848
{
3949
get
@@ -42,6 +52,7 @@ public override string AppRelativeCurrentExecutionFilePath
4252
}
4353
}
4454

55+
/// <inheritdoc />
4556
public override string PathInfo
4657
{
4758
get
@@ -50,6 +61,7 @@ public override string PathInfo
5061
}
5162
}
5263

64+
/// <inheritdoc />
5365
public override NameValueCollection ServerVariables
5466
{
5567
get

src/FluentAssertions.Mvc.Shared/Fakes/FakeHttpResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33

44
namespace FluentAssertions.Mvc.Fakes
55
{
6+
/// <summary>
7+
/// Mimics a <see cref="HttpResponseBase"/>. For use in testing.
8+
/// </summary>
69
public class FakeHttpResponse : HttpResponseBase
710
{
11+
/// <inheritdoc />
812
public override string ApplyAppPathModifier(string virtualPath)
913
{
1014
return virtualPath;

src/FluentAssertions.Mvc.Shared/PartialViewResultAssertions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@
99

1010
namespace FluentAssertions.Mvc
1111
{
12+
/// <summary>
13+
/// Container for methods that can verify the state or behaviour of a <see cref="PartialViewResult"/>
14+
/// </summary>
1215
[DebuggerNonUserCode]
1316
public class PartialViewResultAssertions : ViewResultBaseAssertions<PartialViewResult>
1417
{
18+
/// <summary>
19+
/// Creates a new instance of <see cref="PartialViewResultAssertions"/>
20+
/// </summary>
21+
/// <param name="viewResult"></param>
1522
public PartialViewResultAssertions(PartialViewResult viewResult) : base(viewResult) { }
1623
}
1724
}

src/FluentAssertions.Mvc.Shared/RedirectResultAssertions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public RedirectResultAssertions(RedirectResult subject) : base(subject) { }
3131
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
3232
/// </param>
3333
/// <param name="reasonArgs">
34-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
34+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
3535
/// </param>
3636
public RedirectResultAssertions WithUrl(string expectedUrl, string reason = "", params object[] reasonArgs)
3737
{
@@ -58,7 +58,7 @@ public RedirectResultAssertions WithUrl(string expectedUrl, string reason = "",
5858
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
5959
/// </param>
6060
/// <param name="reasonArgs">
61-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
61+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
6262
/// </param>
6363
public RedirectResultAssertions WithPermanent(bool expectedPermanent, string reason = "", params object[] reasonArgs)
6464
{

src/FluentAssertions.Mvc.Shared/RedirectToRouteAssertions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public RedirectToRouteAssertions(RedirectToRouteResult subject)
3535
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
3636
/// </param>
3737
/// <param name="reasonArgs">
38-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
38+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
3939
/// </param>
4040
public RedirectToRouteAssertions WithPermanent(bool expectedPermanent, string reason = "", params object[] reasonArgs)
4141
{
@@ -55,7 +55,7 @@ public RedirectToRouteAssertions WithPermanent(bool expectedPermanent, string re
5555
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
5656
/// </param>
5757
/// <param name="reasonArgs">
58-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
58+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
5959
/// </param>
6060
public RedirectToRouteAssertions WithRouteName(string expectedRouteName, string reason = "", params object[] reasonArgs)
6161
{
@@ -81,7 +81,7 @@ public RedirectToRouteAssertions WithRouteName(string expectedRouteName, string
8181
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
8282
/// </param>
8383
/// <param name="reasonArgs">
84-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
84+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
8585
/// </param>
8686
public RedirectToRouteAssertions WithRouteValue(string key, object expectedValue, string reason = "", params object[] reasonArgs)
8787
{
@@ -98,7 +98,7 @@ public RedirectToRouteAssertions WithRouteValue(string key, object expectedValue
9898
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
9999
/// </param>
100100
/// <param name="reasonArgs">
101-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
101+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
102102
/// </param>
103103
public RedirectToRouteAssertions WithController(string expectedControllerName, string reason = "", params object[] reasonArgs)
104104
{
@@ -115,7 +115,7 @@ public RedirectToRouteAssertions WithController(string expectedControllerName, s
115115
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
116116
/// </param>
117117
/// <param name="reasonArgs">
118-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
118+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
119119
/// </param>
120120
public RedirectToRouteAssertions WithAction(string expectedAction, string reason = "", params object[] reasonArgs)
121121
{
@@ -132,7 +132,7 @@ public RedirectToRouteAssertions WithAction(string expectedAction, string reason
132132
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
133133
/// </param>
134134
/// <param name="reasonArgs">
135-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
135+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
136136
/// </param>
137137
public RedirectToRouteAssertions WithArea(string expectedArea, string reason = "", params object[] reasonArgs)
138138
{

src/FluentAssertions.Mvc.Shared/RouteCollection_Extensions.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@
99

1010
namespace FluentAssertions.Mvc
1111
{
12+
/// <summary>
13+
/// Container for extension methods for <see cref="RouteCollection"/>
14+
/// </summary>
1215
[DebuggerNonUserCode]
1316
public static class RouteCollection_Extensions
1417
{
18+
/// <summary>
19+
/// Spoofs a call to <see cref="RouteCollection.GetRouteData(System.Web.HttpContextBase)"/> with the use of a stub <see cref="System.Web.HttpContextBase"/>.
20+
/// </summary>
21+
/// <param name="routes">The <see cref="RouteCollection"/> to spoof the call on.</param>
22+
/// <param name="url">The url of interest</param>
23+
/// <returns>A <see cref="RouteCollection"/> for the given <paramref name="url"/></returns>
1524
public static RouteData GetRouteDataForUrl(this RouteCollection routes, string url)
1625
{
1726
var context = new FakeHttpContext("/", url);

src/FluentAssertions.Mvc.Shared/RouteDataAssertions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
namespace FluentAssertions.Mvc
1616
{
17-
[DebuggerNonUserCode]
1817
/// <summary>
1918
/// Contains a number of methods to assert that a <see cref="RouteData"/> is in the expected state.
2019
/// </summary>
20+
[DebuggerNonUserCode]
2121
public class RouteDataAssertions : ObjectAssertions
2222
{
2323
/// <summary>
@@ -38,7 +38,7 @@ public RouteDataAssertions(RouteData subject)
3838
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
3939
/// </param>
4040
/// <param name="reasonArgs">
41-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
41+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
4242
/// </param>
4343
public RouteDataAssertions HaveController(string expectedControllerName, string reason = "", params object[] reasonArgs)
4444
{
@@ -55,7 +55,7 @@ public RouteDataAssertions HaveController(string expectedControllerName, string
5555
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
5656
/// </param>
5757
/// <param name="reasonArgs">
58-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
58+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
5959
/// </param>
6060
public RouteDataAssertions HaveAction(string expectedActionName, string reason = "", params object[] reasonArgs)
6161
{
@@ -73,7 +73,7 @@ public RouteDataAssertions HaveAction(string expectedActionName, string reason =
7373
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
7474
/// </param>
7575
/// <param name="reasonArgs">
76-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
76+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
7777
/// </param>
7878
public RouteDataAssertions HaveDataToken(string key, object expectedValue, string reason = "", params object[] reasonArgs)
7979
{
@@ -104,7 +104,7 @@ public RouteDataAssertions HaveDataToken(string key, object expectedValue, strin
104104
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
105105
/// </param>
106106
/// <param name="reasonArgs">
107-
/// Zero or more objects to format using the placeholders in <see cref="reason" />.
107+
/// Zero or more objects to format using the placeholders in <paramref name="reason"/>.
108108
/// </param>
109109
public RouteDataAssertions HaveValue(string key, object expectedValue, string reason = "", params object[] reasonArgs)
110110
{

src/FluentAssertions.Mvc.Shared/RouteValueDictionary_Extensions.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55

66
namespace FluentAssertions.Mvc
77
{
8+
/// <summary>
9+
/// Contains extension methods for <see cref="RouteValueDictionary"/>
10+
/// </summary>
811
public static class RouteValueDictionary_Extensions
912
{
13+
/// <summary>
14+
/// Wraps a call to <see cref="UrlHelper.GenerateUrl(string, string, string, RouteValueDictionary, RouteCollection, RequestContext, bool)"/> using a stub <see cref="System.Web.HttpContextBase"/>
15+
/// </summary>
16+
/// <param name="routeValues">The <see cref="RouteValueDictionary"/> to generate the URL from</param>
17+
/// <param name="routes">a <see cref="RouteCollection"/> for use when generating a URL</param>
18+
/// <returns>A URL value generated from the given <paramref name="routeValues"/> and <paramref name="routes"/></returns>
1019
public static string GenerateUrl(this RouteValueDictionary routeValues, RouteCollection routes)
1120
{
1221
var context = new FakeHttpContext("/", "~/");

0 commit comments

Comments
 (0)