Skip to content

Commit 0240128

Browse files
committed
Added documentation summary for data provider test builders
1 parent a480aba commit 0240128

39 files changed

+644
-132
lines changed

src/MyTested.Mvc/Builders/Attributes/BaseAttributesTestBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ internal ICollection<Action<IEnumerable<object>>> GetAttributeValidations()
3737
}
3838

3939
/// <summary>
40-
/// Checks whether the collected attributes contain the provided attribute type.
40+
/// Tests whether the action attributes contain the provided attribute type.
4141
/// </summary>
4242
/// <typeparam name="TAttribute">Type of expected attribute.</typeparam>
4343
/// <param name="failedValidationAction">Action to execute, if the validation fails.</param>
@@ -57,7 +57,7 @@ protected void ContainingAttributeOfType<TAttribute>(Action<string, string> fail
5757
}
5858

5959
/// <summary>
60-
/// Checks whether the collected attributes contain RouteAttribute.
60+
/// Tests whether the action attributes contain RouteAttribute.
6161
/// </summary>
6262
/// <param name="template">Expected overridden route template of the action.</param>
6363
/// <param name="failedValidationAction">Action to execute, if the validation fails.</param>
@@ -100,7 +100,7 @@ protected void ChangingRouteTo(
100100
}
101101

102102
/// <summary>
103-
/// Checks whether the collected attributes contain AuthorizeAttribute.
103+
/// Tests whether the action attributes contain <see cref="Microsoft.AspNetCore.Authorization.AuthorizeAttribute"/>.
104104
/// </summary>
105105
/// <param name="failedValidationAction">Action to execute, if the validation fails.</param>
106106
/// <param name="withAllowedRoles">Optional expected authorized roles.</param>

src/MyTested.Mvc/Builders/Contracts/Attributes/IActionAttributesTestBuilder.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,49 +8,49 @@
88
public interface IActionAttributesTestBuilder
99
{
1010
/// <summary>
11-
/// Checks whether the collected attributes contain the provided attribute type.
11+
/// Tests whether the action attributes contain the provided attribute type.
1212
/// </summary>
1313
/// <typeparam name="TAttribute">Type of expected attribute.</typeparam>
14-
/// <returns>The same attributes test builder.</returns>
14+
/// <returns>The same <see cref="IAndActionAttributesTestBuilder"/>.</returns>
1515
IAndActionAttributesTestBuilder ContainingAttributeOfType<TAttribute>()
1616
where TAttribute : Attribute;
1717

1818
/// <summary>
19-
/// Checks whether the collected attributes contain ActionNameAttribute.
19+
/// Tests whether the action attributes contain <see cref="Microsoft.AspNetCore.Mvc.ActionNameAttribute"/>.
2020
/// </summary>
2121
/// <param name="actionName">Expected overridden name of the action.</param>
22-
/// <returns>The same attributes test builder.</returns>
22+
/// <returns>The same <see cref="IAndActionAttributesTestBuilder"/>.</returns>
2323
IAndActionAttributesTestBuilder ChangingActionNameTo(string actionName);
2424

2525
/// <summary>
26-
/// Checks whether the collected attributes contain RouteAttribute.
26+
/// Tests whether the action attributes contain <see cref="Microsoft.AspNetCore.Mvc.RouteAttribute"/>.
2727
/// </summary>
2828
/// <param name="template">Expected overridden route template of the action.</param>
2929
/// <param name="withName">Optional expected route name.</param>
3030
/// <param name="withOrder">Optional expected route order.</param>
31-
/// <returns>The same attributes test builder.</returns>
31+
/// <returns>The same <see cref="IAndActionAttributesTestBuilder"/>.</returns>
3232
IAndActionAttributesTestBuilder ChangingRouteTo(
3333
string template,
3434
string withName = null,
3535
int? withOrder = null);
3636

3737
/// <summary>
38-
/// Checks whether the collected attributes contain AllowAnonymousAttribute.
38+
/// Tests whether the action attributes contain <see cref="Microsoft.AspNetCore.Authorization.AllowAnonymousAttribute"/>.
3939
/// </summary>
40-
/// <returns>The same attributes test builder.</returns>
40+
/// <returns>The same <see cref="IAndActionAttributesTestBuilder"/>.</returns>
4141
IAndActionAttributesTestBuilder AllowingAnonymousRequests();
4242

4343
/// <summary>
44-
/// Checks whether the collected attributes contain AuthorizeAttribute.
44+
/// Tests whether the action attributes contain <see cref="Microsoft.AspNetCore.Authorization.AuthorizeAttribute"/>.
4545
/// </summary>
4646
/// <param name="withAllowedRoles">Optional expected authorized roles.</param>
47-
/// <returns>The same attributes test builder.</returns>
47+
/// <returns>The same <see cref="IAndActionAttributesTestBuilder"/>.</returns>
4848
IAndActionAttributesTestBuilder RestrictingForAuthorizedRequests(string withAllowedRoles = null);
4949

5050
/// <summary>
51-
/// Checks whether the collected attributes contain NonActionAttribute.
51+
/// Tests whether the action attributes contain <see cref="Microsoft.AspNetCore.Mvc.NonActionAttribute"/>.
5252
/// </summary>
53-
/// <returns>The same attributes test builder.</returns>
53+
/// <returns>The same <see cref="IAndActionAttributesTestBuilder"/>.</returns>
5454
IAndActionAttributesTestBuilder DisablingActionCall();
5555
}
5656
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
namespace MyTested.Mvc.Builders.Contracts.Attributes
22
{
33
/// <summary>
4-
/// Used for adding AndAlso() method to the the attribute tests.
4+
/// Used for adding AndAlso() method to the action attributes tests.
55
/// </summary>
66
public interface IAndActionAttributesTestBuilder : IActionAttributesTestBuilder
77
{
88
/// <summary>
9-
/// AndAlso method for better readability when chaining attribute tests.
9+
/// AndAlso method for better readability when chaining action attributes tests.
1010
/// </summary>
11-
/// <returns>The same attributes test builder.</returns>
11+
/// <returns>The same <see cref="IActionAttributesTestBuilder"/>.</returns>
1212
IActionAttributesTestBuilder AndAlso();
1313
}
1414
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
namespace MyTested.Mvc.Builders.Contracts.Attributes
22
{
33
/// <summary>
4-
/// Used for adding AndAlso() method to the the attribute tests.
4+
/// Used for adding AndAlso() method to the controller attributes tests.
55
/// </summary>
66
public interface IAndControllerAttributesTestBuilder : IControllerAttributesTestBuilder
77
{
88
/// <summary>
9-
/// AndAlso method for better readability when chaining attribute tests.
9+
/// AndAlso method for better readability when chaining controller attributes tests.
1010
/// </summary>
11-
/// <returns>The same attributes test builder.</returns>
11+
/// <returns>The same <see cref="IControllerAttributesTestBuilder"/>.</returns>
1212
IControllerAttributesTestBuilder AndAlso();
1313
}
1414
}

src/MyTested.Mvc/Builders/Contracts/Attributes/IControllerAttributesTestBuilder.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,33 @@ public interface IControllerAttributesTestBuilder
1111
/// Checks whether the collected attributes contain the provided attribute type.
1212
/// </summary>
1313
/// <typeparam name="TAttribute">Type of expected attribute.</typeparam>
14-
/// <returns>The same attributes test builder.</returns>
14+
/// <returns>The same <see cref="IAndControllerAttributesTestBuilder"/>.</returns>
1515
IAndControllerAttributesTestBuilder ContainingAttributeOfType<TAttribute>()
1616
where TAttribute : Attribute;
1717

1818
/// <summary>
19-
/// Checks whether the collected attributes contain RouteAttribute.
19+
/// Checks whether the collected attributes contain <see cref="Microsoft.AspNetCore.Mvc.RouteAttribute"/>.
2020
/// </summary>
2121
/// <param name="template">Expected overridden route template of the controller.</param>
2222
/// <param name="withName">Optional expected route name.</param>
2323
/// <param name="withOrder">Optional expected route order.</param>
24-
/// <returns>The same attributes test builder.</returns>
24+
/// <returns>The same <see cref="IAndControllerAttributesTestBuilder"/>.</returns>
2525
IAndControllerAttributesTestBuilder ChangingRouteTo(
2626
string template,
2727
string withName = null,
2828
int? withOrder = null);
29-
29+
3030
/// <summary>
31-
/// Checks whether the collected attributes contain AllowAnonymousAttribute.
31+
/// Checks whether the collected attributes contain <see cref="Microsoft.AspNetCore.Authorization.AllowAnonymousAttribute"/>.
3232
/// </summary>
33-
/// <returns>The same attributes test builder.</returns>
33+
/// <returns>The same <see cref="IAndControllerAttributesTestBuilder"/>.</returns>
3434
IAndControllerAttributesTestBuilder AllowingAnonymousRequests();
3535

3636
/// <summary>
37-
/// Checks whether the collected attributes contain AuthorizeAttribute.
37+
/// Checks whether the collected attributes contain <see cref="Microsoft.AspNetCore.Authorization.AuthorizeAttribute"/>.
3838
/// </summary>
3939
/// <param name="withAllowedRoles">Optional expected authorized roles.</param>
40-
/// <returns>The same attributes test builder.</returns>
40+
/// <returns>The same <see cref="IAndControllerAttributesTestBuilder"/>.</returns>
4141
IAndControllerAttributesTestBuilder RestrictingForAuthorizedRequests(
4242
string withAllowedRoles = null);
4343
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
namespace MyTested.Mvc.Builders.Contracts.Authentication
22
{
33
/// <summary>
4-
/// Used for adding AndAlso() method to the authentication properties tests.
4+
/// Used for adding AndAlso() method to the <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/> tests.
55
/// </summary>
66
public interface IAndAuthenticationPropertiesTestBuilder : IAuthenticationPropertiesTestBuilder
77
{
88
/// <summary>
9-
/// AndAlso method for better readability when testing authentication properties.
9+
/// AndAlso method for better readability when testing <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/>.
1010
/// </summary>
11-
/// <returns>The same authentication properties test builder.</returns>
11+
/// <returns>The same <see cref="IAuthenticationPropertiesTestBuilder"/>.</returns>
1212
IAuthenticationPropertiesTestBuilder AndAlso();
1313
}
1414
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
namespace MyTested.Mvc.Builders.Contracts.Authentication
22
{
33
/// <summary>
4-
/// Used for adding AndAlso() method to the claims identity builder.
4+
/// Used for adding AndAlso() method to the <see cref="System.Security.Claims.ClaimsIdentity"/> builder.
55
/// </summary>
66
public interface IAndClaimsIdentityBuilder : IClaimsIdentityBuilder
77
{
88
/// <summary>
9-
/// AndAlso method for better readability when building claims identity.
9+
/// AndAlso method for better readability when building mocked <see cref="System.Security.Claims.ClaimsIdentity"/>.
1010
/// </summary>
11-
/// <returns>The same claims identity builder.</returns>
11+
/// <returns>The same <see cref="IClaimsIdentityBuilder"/>.</returns>
1212
IClaimsIdentityBuilder AndAlso();
1313
}
1414
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
namespace MyTested.Mvc.Builders.Contracts.Authentication
22
{
33
/// <summary>
4-
/// Used for adding AndAlso() method to the claims principal builder.
4+
/// Used for adding AndAlso() method to the <see cref="System.Security.Claims.ClaimsPrincipal"/> builder.
55
/// </summary>
66
public interface IAndClaimsPrincipalBuilder : IClaimsPrincipalBuilder
77
{
88
/// <summary>
9-
/// AndAlso method for better readability when building claims principal.
9+
/// AndAlso method for better readability when building <see cref="System.Security.Claims.ClaimsPrincipal"/>.
1010
/// </summary>
11-
/// <returns>The same claims principal builder.</returns>
11+
/// <returns>The same <see cref="IClaimsPrincipalBuilder"/>.</returns>
1212
IClaimsPrincipalBuilder AndAlso();
1313
}
1414
}

src/MyTested.Mvc/Builders/Contracts/Authentication/IAuthenticationPropertiesTestBuilder.cs

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,65 +4,81 @@
44
using System.Collections.Generic;
55

66
/// <summary>
7-
/// Used for testing authentication properties.
7+
/// Used for testing <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/>.
88
/// </summary>
99
public interface IAuthenticationPropertiesTestBuilder
1010
{
1111
/// <summary>
12-
/// Tests whether authentication properties has the same allow refresh value as the provided one.
12+
/// Tests whether <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/>
13+
/// has the same <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties.AllowRefresh"/> value as the provided one.
1314
/// </summary>
1415
/// <param name="allowRefresh">Expected allow refresh value.</param>
15-
/// <returns>The same authentication properties test builder.</returns>
16+
/// <returns>The same <see cref="IAndAuthenticationPropertiesTestBuilder"/>.</returns>
1617
IAndAuthenticationPropertiesTestBuilder WithAllowRefresh(bool? allowRefresh);
1718

1819
/// <summary>
19-
/// Tests whether authentication properties has the same expires value as the provided one.
20+
/// Tests whether <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/>
21+
/// has the same <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties.ExpiresUtc"/> value as the provided one.
2022
/// </summary>
2123
/// <param name="expiresUtc">Expected expires value.</param>
22-
/// <returns>The same authentication properties test builder.</returns>
24+
/// <returns>The same <see cref="IAndAuthenticationPropertiesTestBuilder"/>.</returns>
2325
IAndAuthenticationPropertiesTestBuilder WithExpires(DateTimeOffset? expiresUtc);
2426

2527
/// <summary>
26-
/// Tests whether authentication properties has the same is persistent value as the provided one.
28+
/// Tests whether <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/>
29+
/// has the same <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties.IsPersistent"/> value as the provided one.
2730
/// </summary>
2831
/// <param name="isPersistent">Expected is persistent value.</param>
29-
/// <returns>The same authentication properties test builder.</returns>
32+
/// <returns>The same <see cref="IAndAuthenticationPropertiesTestBuilder"/>.</returns>
3033
IAndAuthenticationPropertiesTestBuilder WithIsPersistent(bool isPersistent);
3134

3235
/// <summary>
33-
/// Tests whether authentication properties has the same issued value as the provided one.
36+
/// Tests whether <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/>
37+
/// has the same <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties.IssuedUtc"/> value as the provided one.
3438
/// </summary>
3539
/// <param name="issuedUtc">Expected issued value.</param>
36-
/// <returns>The same authentication properties test builder.</returns>
40+
/// <returns>The same <see cref="IAndAuthenticationPropertiesTestBuilder"/>.</returns>
3741
IAndAuthenticationPropertiesTestBuilder WithIssued(DateTimeOffset? issuedUtc);
3842

3943
/// <summary>
40-
/// Tests whether authentication properties contains the provided item key.
44+
/// Tests whether <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/>
45+
/// contains the provided item key in its <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties.Items"/> collection.
4146
/// </summary>
4247
/// <param name="itemKey">Expected item key.</param>
43-
/// <returns>The same authentication properties test builder.</returns>
48+
/// <returns>The same <see cref="IAndAuthenticationPropertiesTestBuilder"/>.</returns>
4449
IAndAuthenticationPropertiesTestBuilder WithItem(string itemKey);
4550

4651
/// <summary>
47-
/// Tests whether authentication properties contains the provided item key and value.
52+
/// Tests whether <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/> contains the provided item key and value
53+
/// in its <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties.Items"/> collection.
4854
/// </summary>
4955
/// <param name="itemKey">Expected item key.</param>
5056
/// <param name="itemValue">Expected item value.</param>
51-
/// <returns>The same authentication properties test builder.</returns>
57+
/// <returns>The same <see cref="IAndAuthenticationPropertiesTestBuilder"/>.</returns>
5258
IAndAuthenticationPropertiesTestBuilder WithItem(string itemKey, string itemValue);
5359

5460
/// <summary>
55-
/// Tests whether authentication properties contains the provided items.
61+
/// Tests whether <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/> contains the provided items
62+
/// in its <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties.Items"/> collection.
63+
/// </summary>
64+
/// <param name="items">Expected items as anonymous object.</param>
65+
/// <returns>The same <see cref="IAndAuthenticationPropertiesTestBuilder"/>.</returns>
66+
IAndAuthenticationPropertiesTestBuilder WithItems(object items);
67+
68+
/// <summary>
69+
/// Tests whether <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/> contains the provided items
70+
/// in its <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties.Items"/> collection.
5671
/// </summary>
5772
/// <param name="items">Expected items as dictionary.</param>
58-
/// <returns>The same authentication properties test builder.</returns>
73+
/// <returns>The same <see cref="IAndAuthenticationPropertiesTestBuilder"/>.</returns>
5974
IAndAuthenticationPropertiesTestBuilder WithItems(IDictionary<string, string> items);
6075

6176
/// <summary>
62-
/// Tests whether authentication properties has the same redirect URI as the provided one.
77+
/// Tests whether <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties"/>
78+
/// has the same <see cref="Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties.RedirectUri"/> as the provided one.
6379
/// </summary>
6480
/// <param name="redirectUri">Expected redirect URI.</param>
65-
/// <returns>The same authentication properties test builder.</returns>
81+
/// <returns>The same <see cref="IAndAuthenticationPropertiesTestBuilder"/>.</returns>
6682
IAndAuthenticationPropertiesTestBuilder WithRedirectUri(string redirectUri);
6783
}
6884
}

0 commit comments

Comments
 (0)