Skip to content

Commit 678862d

Browse files
committed
Added documentation for some of the action result test builders
1 parent 5b47a7b commit 678862d

19 files changed

+290
-187
lines changed

src/MyTested.Mvc/Builders/Contracts/ActionResults/BadRequest/IAndBadRequestTestBuilder.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
namespace MyTested.Mvc.Builders.Contracts.ActionResults.BadRequest
22
{
33
/// <summary>
4-
/// Used for adding AndAlso() method to the HTTP bad request result tests.
4+
/// Used for adding AndAlso() method to the <see cref="Microsoft.AspNetCore.Mvc.BadRequestResult"/>
5+
/// and <see cref="Microsoft.AspNetCore.Mvc.BadRequestObjectResult"/> tests.
56
/// </summary>
67
public interface IAndBadRequestTestBuilder : IBadRequestTestBuilder
78
{
89
/// <summary>
9-
/// AndAlso method for better readability when chaining HTTP bad request result tests.
10+
/// AndAlso method for better readability when chaining <see cref="Microsoft.AspNetCore.Mvc.BadRequestResult"/>
11+
/// and <see cref="Microsoft.AspNetCore.Mvc.BadRequestObjectResult"/> tests.
1012
/// </summary>
1113
/// <returns>The same <see cref="IBadRequestTestBuilder"/>.</returns>
1214
IBadRequestTestBuilder AndAlso();

src/MyTested.Mvc/Builders/Contracts/ActionResults/BadRequest/IBadRequestErrorMessageTestBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Base;
44

55
/// <summary>
6-
/// Used for testing specific bad request text error messages.
6+
/// Used for testing specific <see cref="Microsoft.AspNetCore.Mvc.BadRequestObjectResult"/> text error messages.
77
/// </summary>
88
public interface IBadRequestErrorMessageTestBuilder : IBaseTestBuilderWithInvokedAction
99
{

src/MyTested.Mvc/Builders/Contracts/ActionResults/BadRequest/IBadRequestTestBuilder.cs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,147 +10,147 @@
1010
using Models;
1111

1212
/// <summary>
13-
/// Used for testing HTTP bad request results.
13+
/// Used for testing <see cref="BadRequestResult"/> and <see cref="BadRequestObjectResult"/>.
1414
/// </summary>
1515
public interface IBadRequestTestBuilder : IBaseTestBuilderWithActionResult<ActionResult>
1616
{
1717
/// <summary>
18-
/// Tests whether HTTP bad request result contains deeply equal error value as the provided error object.
18+
/// Tests whether <see cref="BadRequestObjectResult"/> contains deeply equal error value as the provided error object.
1919
/// </summary>
2020
/// <typeparam name="TError">Type of error object.</typeparam>
2121
/// <param name="error">Error object.</param>
2222
/// <returns>Test builder of type <see cref="IModelDetailsTestBuilder{TError}"/>.</returns>
2323
IModelDetailsTestBuilder<TError> WithError<TError>(TError error);
2424

2525
/// <summary>
26-
/// Tests whether HTTP bad request result contains error object of the provided type.
26+
/// Tests whether <see cref="BadRequestObjectResult"/> contains error object of the provided type.
2727
/// </summary>
2828
/// <typeparam name="TError">Type of error object.</typeparam>
2929
/// <returns>Test builder of type <see cref="IModelDetailsTestBuilder{TError}"/>.</returns>
3030
IModelDetailsTestBuilder<TError> WithErrorOfType<TError>();
3131

3232
/// <summary>
33-
/// Tests whether no specific error is returned from the HTTP bad request result.
33+
/// Tests whether no specific error is returned from the <see cref="BadRequestObjectResult"/>.
3434
/// </summary>
3535
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
3636
IAndBadRequestTestBuilder WithNoError();
3737

3838
/// <summary>
39-
/// Tests HTTP bad request result with specific text error message using test builder.
39+
/// Tests <see cref="BadRequestObjectResult"/> with specific text error message using test builder.
4040
/// </summary>
4141
/// <returns><see cref="IBadRequestErrorMessageTestBuilder"/>.</returns>
4242
IBadRequestErrorMessageTestBuilder WithErrorMessage();
4343

4444
/// <summary>
45-
/// Tests HTTP bad request result with specific text error message provided by string.
45+
/// Tests <see cref="BadRequestObjectResult"/> with specific text error message provided by string.
4646
/// </summary>
47-
/// <param name="message">Expected error message from bad request result.</param>
47+
/// <param name="message">Expected error message.</param>
4848
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
4949
IAndBadRequestTestBuilder WithErrorMessage(string message);
5050

5151
/// <summary>
52-
/// Tests whether HTTP bad request result contains the controller's <see cref="ModelStateDictionary"/> as object error.
52+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the controller's <see cref="ModelStateDictionary"/> as object error.
5353
/// </summary>
5454
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
5555
IAndBadRequestTestBuilder WithModelStateError();
5656

5757
/// <summary>
58-
/// Tests HTTP bad request result with specific <see cref="ModelStateDictionary"/>.
58+
/// Tests whether <see cref="BadRequestObjectResult"/> contains specific <see cref="ModelStateDictionary"/>.
5959
/// </summary>
6060
/// <param name="modelState"><see cref="ModelStateDictionary"/> to deeply compare to the actual one.</param>
6161
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
6262
IAndBadRequestTestBuilder WithModelStateError(ModelStateDictionary modelState);
6363

6464
/// <summary>
65-
/// Tests HTTP bad request result for model state errors using test builder.
65+
/// Tests whether <see cref="BadRequestObjectResult"/> contains specific model state errors using test builder.
6666
/// </summary>
6767
/// <typeparam name="TRequestModel">Type of model for which the model state errors will be tested.</typeparam>
6868
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
6969
IModelErrorTestBuilder<TRequestModel> WithModelStateErrorFor<TRequestModel>();
7070

7171
/// <summary>
72-
/// Tests whether HTTP bad request result has the same status code as the provided one.
72+
/// Tests whether <see cref="BadRequestResult"/> or <see cref="BadRequestObjectResult"/> has the same status code as the provided one.
7373
/// </summary>
74-
/// <param name="statusCode">Status code.</param>
74+
/// <param name="statusCode">Status code as integer.</param>
7575
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
7676
IAndBadRequestTestBuilder WithStatusCode(int statusCode);
7777

7878
/// <summary>
79-
/// Tests whether HTTP bad request has the same status code as the provided <see cref="HttpStatusCode"/>.
79+
/// Tests whether <see cref="BadRequestResult"/> or <see cref="BadRequestObjectResult"/> has the same status code as the provided <see cref="HttpStatusCode"/>.
8080
/// </summary>
8181
/// <param name="statusCode"><see cref="HttpStatusCode"/> enumeration.</param>
8282
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
8383
IAndBadRequestTestBuilder WithStatusCode(HttpStatusCode statusCode);
8484

8585
/// <summary>
86-
/// Tests whether HTTP bad request result contains the content type provided as string.
86+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the content type provided as string.
8787
/// </summary>
8888
/// <param name="contentType">Content type as string.</param>
8989
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
9090
IAndBadRequestTestBuilder ContainingContentType(string contentType);
9191

9292
/// <summary>
93-
/// Tests whether HTTP bad request result contains the content type provided as <see cref="MediaTypeHeaderValue"/>.
93+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the content type provided as <see cref="MediaTypeHeaderValue"/>.
9494
/// </summary>
9595
/// <param name="contentType">Content type as MediaTypeHeaderValue.</param>
9696
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
9797
IAndBadRequestTestBuilder ContainingContentType(MediaTypeHeaderValue contentType);
9898

9999
/// <summary>
100-
/// Tests whether HTTP bad request result contains the same content types provided as enumerable of strings.
100+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the same content types provided as enumerable of strings.
101101
/// </summary>
102102
/// <param name="contentTypes">Content types as enumerable of strings.</param>
103103
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
104104
IAndBadRequestTestBuilder ContainingContentTypes(IEnumerable<string> contentTypes);
105105

106106
/// <summary>
107-
/// Tests whether HTTP bad request result contains the same content types provided as string parameters.
107+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the same content types provided as string parameters.
108108
/// </summary>
109109
/// <param name="contentTypes">Content types as string parameters.</param>
110110
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
111111
IAndBadRequestTestBuilder ContainingContentTypes(params string[] contentTypes);
112112

113113
/// <summary>
114-
/// Tests whether HTTP bad request result contains the same content types provided as enumerable of <see cref="MediaTypeHeaderValue"/>.
114+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the same content types provided as enumerable of <see cref="MediaTypeHeaderValue"/>.
115115
/// </summary>
116116
/// <param name="contentTypes">Content types as enumerable of <see cref="MediaTypeHeaderValue"/>.</param>
117117
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
118118
IAndBadRequestTestBuilder ContainingContentTypes(IEnumerable<MediaTypeHeaderValue> contentTypes);
119119

120120
/// <summary>
121-
/// Tests whether HTTP bad request result contains the same content types provided as <see cref="MediaTypeHeaderValue"/> parameters.
121+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the same content types provided as <see cref="MediaTypeHeaderValue"/> parameters.
122122
/// </summary>
123123
/// <param name="contentTypes">Content types as <see cref="MediaTypeHeaderValue"/> parameters.</param>
124124
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
125125
IAndBadRequestTestBuilder ContainingContentTypes(params MediaTypeHeaderValue[] contentTypes);
126126

127127
/// <summary>
128-
/// Tests whether HTTP bad request result contains the provided output formatter.
128+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the provided output formatter.
129129
/// </summary>
130130
/// <param name="outputFormatter">Instance of <see cref="IOutputFormatter"/>.</param>
131131
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
132132
IAndBadRequestTestBuilder ContainingOutputFormatter(IOutputFormatter outputFormatter);
133133

134134
/// <summary>
135-
/// Tests whether HTTP bad request result contains output formatter of the provided type.
135+
/// Tests whether <see cref="BadRequestObjectResult"/> contains output formatter of the provided type.
136136
/// </summary>
137137
/// <typeparam name="TOutputFormatter">Type of <see cref="IOutputFormatter"/>.</typeparam>
138138
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
139139
IAndBadRequestTestBuilder ContainingOutputFormatterOfType<TOutputFormatter>()
140140
where TOutputFormatter : IOutputFormatter;
141141

142142
/// <summary>
143-
/// Tests whether HTTP bad request result contains the provided output formatters.
143+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the provided output formatters.
144144
/// </summary>
145145
/// <param name="outputFormatters">Enumerable of <see cref="IOutputFormatter"/>.</param>
146-
/// <returns>The same HTTP bad request test builder.</returns>
146+
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
147147
IAndBadRequestTestBuilder ContainingOutputFormatters(IEnumerable<IOutputFormatter> outputFormatters);
148148

149149
/// <summary>
150-
/// Tests whether HTTP bad request result contains the provided output formatters.
150+
/// Tests whether <see cref="BadRequestObjectResult"/> contains the provided output formatters.
151151
/// </summary>
152152
/// <param name="outputFormatters"><see cref="IOutputFormatter"/> parameters.</param>
153-
/// <returns>The same HTTP bad request test builder.</returns>
153+
/// <returns>The same <see cref="IAndBadRequestTestBuilder"/>.</returns>
154154
IAndBadRequestTestBuilder ContainingOutputFormatters(params IOutputFormatter[] outputFormatters);
155155
}
156156
}

src/MyTested.Mvc/Builders/Contracts/ActionResults/Challenge/IAndChallengeTestBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
namespace MyTested.Mvc.Builders.Contracts.ActionResults.Challenge
22
{
33
/// <summary>
4-
/// Used for adding AndAlso() method to the challenge result tests.
4+
/// Used for adding AndAlso() method to the <see cref="Microsoft.AspNetCore.Mvc.ChallengeResult"/> tests.
55
/// </summary>
66
public interface IAndChallengeTestBuilder : IChallengeTestBuilder
77
{
88
/// <summary>
9-
/// AndAlso method for better readability when chaining challenge tests.
9+
/// AndAlso method for better readability when chaining <see cref="Microsoft.AspNetCore.Mvc.ChallengeResult"/> tests.
1010
/// </summary>
1111
/// <returns>The same <see cref="IChallengeTestBuilder"/>.</returns>
1212
IChallengeTestBuilder AndAlso();

src/MyTested.Mvc/Builders/Contracts/ActionResults/Challenge/IChallengeTestBuilder.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,40 @@
88
using Microsoft.AspNetCore.Mvc;
99

1010
/// <summary>
11-
/// Used for testing challenge result.
11+
/// Used for testing <see cref="ChallengeResult"/>.
1212
/// </summary>
1313
public interface IChallengeTestBuilder : IBaseTestBuilderWithActionResult<ChallengeResult>
1414
{
1515
/// <summary>
16-
/// Tests whether challenge result contains specific authentication scheme provided by string.
16+
/// Tests whether <see cref="ChallengeResult"/> contains specific authentication scheme provided by string.
1717
/// </summary>
1818
/// <param name="authenticationScheme">Expected authentication scheme as string.</param>
1919
/// <returns>The same <see cref="IAndChallengeTestBuilder"/>.</returns>
2020
IAndChallengeTestBuilder ContainingAuthenticationScheme(string authenticationScheme);
2121

2222
/// <summary>
23-
/// Tests whether challenge result has the provided enumerable of authentication schemes.
23+
/// Tests whether <see cref="ChallengeResult"/> has the provided enumerable of authentication schemes.
2424
/// </summary>
2525
/// <param name="authenticationSchemes">Expected authentication schemes as enumerable.</param>
2626
/// <returns>The same <see cref="IAndChallengeTestBuilder"/>.</returns>
2727
IAndChallengeTestBuilder ContainingAuthenticationSchemes(IEnumerable<string> authenticationSchemes);
2828

2929
/// <summary>
30-
/// Tests whether challenge result has the provided parameters of authentication schemes.
30+
/// Tests whether <see cref="ChallengeResult"/> has the provided parameters of authentication schemes.
3131
/// </summary>
3232
/// <param name="authenticationSchemes">Expected authentication schemes as string parameters.</param>
3333
/// <returns>The same <see cref="IAndChallengeTestBuilder"/>.</returns>
3434
IAndChallengeTestBuilder ContainingAuthenticationSchemes(params string[] authenticationSchemes);
3535

3636
/// <summary>
37-
/// Tests whether challenge result has the provided <see cref="AuthenticationProperties"/>.
37+
/// Tests whether <see cref="ChallengeResult"/> has the provided <see cref="AuthenticationProperties"/>.
3838
/// </summary>
3939
/// <param name="properties">Expected <see cref="AuthenticationProperties"/>.</param>
4040
/// <returns>The same <see cref="IAndChallengeTestBuilder"/>.</returns>
4141
IAndChallengeTestBuilder WithAuthenticationProperties(AuthenticationProperties properties);
4242

4343
/// <summary>
44-
/// Tests whether challenge result has the given <see cref="AuthenticationProperties"/> provided as builder.
44+
/// Tests whether <see cref="ChallengeResult"/> has the given <see cref="AuthenticationProperties"/> provided as builder.
4545
/// </summary>
4646
/// <param name="authenticationPropertiesBuilder">Expected <see cref="AuthenticationProperties"/> builder.</param>
4747
/// <returns>The same <see cref="IAndChallengeTestBuilder"/>.</returns>

src/MyTested.Mvc/Builders/Contracts/ActionResults/Content/IAndContentTestBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
namespace MyTested.Mvc.Builders.Contracts.ActionResults.Content
22
{
33
/// <summary>
4-
/// Used for adding AndAlso() method to the content result tests.
4+
/// Used for adding AndAlso() method to the <see cref="Microsoft.AspNetCore.Mvc.ContentResult"/> tests.
55
/// </summary>
66
public interface IAndContentTestBuilder : IContentTestBuilder
77
{
88
/// <summary>
9-
/// AndAlso method for better readability when chaining content tests.
9+
/// AndAlso method for better readability when chaining <see cref="Microsoft.AspNetCore.Mvc.ContentResult"/> tests.
1010
/// </summary>
1111
/// <returns>The same <see cref="IContentTestBuilder"/>.</returns>
1212
IContentTestBuilder AndAlso();

src/MyTested.Mvc/Builders/Contracts/ActionResults/Content/IContentTestBuilder.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@
66
using Microsoft.Net.Http.Headers;
77

88
/// <summary>
9-
/// Used for testing content result.
9+
/// Used for testing <see cref="ContentResult"/>.
1010
/// </summary>
1111
public interface IContentTestBuilder : IBaseTestBuilderWithActionResult<ContentResult>
1212
{
1313
/// <summary>
14-
/// Tests whether content result has the same status code as the provided one.
14+
/// Tests whether <see cref="ContentResult"/> has the same status code as the provided one.
1515
/// </summary>
16-
/// <param name="statusCode">Status code.</param>
16+
/// <param name="statusCode">Status code as integer.</param>
1717
/// <returns>The same <see cref="IAndContentTestBuilder"/>.</returns>
1818
IAndContentTestBuilder WithStatusCode(int statusCode);
1919

2020
/// <summary>
21-
/// Tests whether content result has the same status code as the provided <see cref="HttpStatusCode"/>.
21+
/// Tests whether <see cref="ContentResult"/> has the same status code as the provided <see cref="HttpStatusCode"/>.
2222
/// </summary>
2323
/// <param name="statusCode"><see cref="HttpStatusCode"/> enumeration.</param>
2424
/// <returns>The same <see cref="IAndContentTestBuilder"/>.</returns>
2525
IAndContentTestBuilder WithStatusCode(HttpStatusCode statusCode);
2626

2727
/// <summary>
28-
/// Tests whether content result has the same content type as the provided string.
28+
/// Tests whether <see cref="ContentResult"/> has the same content type as the provided string.
2929
/// </summary>
3030
/// <param name="contenType">Content type as string.</param>
3131
/// <returns>The same <see cref="IAndContentTestBuilder"/>.</returns>
3232
IAndContentTestBuilder WithContentType(string contenType);
3333

3434
/// <summary>
35-
/// Tests whether content result has the same content type as the provided <see cref="MediaTypeHeaderValue"/>.
35+
/// Tests whether <see cref="ContentResult"/> has the same content type as the provided <see cref="MediaTypeHeaderValue"/>.
3636
/// </summary>
3737
/// <param name="contenType">Content type as <see cref="MediaTypeHeaderValue"/>.</param>
3838
/// <returns>The same <see cref="IAndContentTestBuilder"/>.</returns>

src/MyTested.Mvc/Builders/Contracts/ActionResults/Created/IAndCreatedTestBuilder.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
namespace MyTested.Mvc.Builders.Contracts.ActionResults.Created
22
{
33
/// <summary>
4-
/// Used for adding AndAlso() method to the created result tests.
4+
/// Used for adding AndAlso() method to the <see cref="Microsoft.AspNetCore.Mvc.CreatedResult"/>,
5+
/// <see cref="Microsoft.AspNetCore.Mvc.CreatedAtActionResult"/> or <see cref="Microsoft.AspNetCore.Mvc.CreatedAtRouteResult"/> tests.
56
/// </summary>
67
public interface IAndCreatedTestBuilder : ICreatedTestBuilder
78
{
89
/// <summary>
9-
/// AndAlso method for better readability when chaining created tests.
10+
/// AndAlso method for better readability when chaining <see cref="Microsoft.AspNetCore.Mvc.CreatedResult"/>,
11+
/// <see cref="Microsoft.AspNetCore.Mvc.CreatedAtActionResult"/> or <see cref="Microsoft.AspNetCore.Mvc.CreatedAtRouteResult"/> tests.
1012
/// </summary>
1113
/// <returns>The same <see cref="ICreatedTestBuilder"/>.</returns>
1214
ICreatedTestBuilder AndAlso();

0 commit comments

Comments
 (0)