Skip to content

Commit 9eed6e0

Browse files
committed
Added documentation summary for AndTestBuilder (#13)
1 parent b8697cc commit 9eed6e0

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

MyWebApi/Builders/Actions/ShouldHaveModelState.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public IModelErrorTestBuilder<TRequestModel> ShouldHaveModelStateFor<TRequestMod
2525
/// <summary>
2626
/// Checks whether the tested action's provided model state is valid.
2727
/// </summary>
28+
/// <returns>Test builder with And method.</returns>
2829
public IAndTestBuilder<TActionResult> ShouldHaveValidModelState()
2930
{
3031
this.CheckValidModelState();
@@ -34,6 +35,7 @@ public IAndTestBuilder<TActionResult> ShouldHaveValidModelState()
3435
/// <summary>
3536
/// Checks whether the tested action's provided model state is not valid.
3637
/// </summary>
38+
/// <returns>Test builder with And method.</returns>
3739
public IAndTestBuilder<TActionResult> ShouldHaveInvalidModelState()
3840
{
3941
if (this.Controller.ModelState.Count == 0)

MyWebApi/Builders/And/AndTestBuilder.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,28 @@
66
using Contracts.Actions;
77
using Contracts.And;
88

9+
/// <summary>
10+
/// Class containing And() method allowing additional assertions after model state tests.
11+
/// </summary>
12+
/// <typeparam name="TActionResult">Result from invoked action in ASP.NET Web API controller.</typeparam>
913
public class AndTestBuilder<TActionResult> : BaseTestBuilderWithActionResult<TActionResult>,
1014
IAndTestBuilder<TActionResult>
1115
{
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="AndTestBuilder{TActionResult}" /> class.
18+
/// </summary>
19+
/// <param name="controller">Controller on which the action will be tested.</param>
20+
/// <param name="actionName">Name of the tested action.</param>
21+
/// <param name="actionResult">Result from the tested action.</param>
1222
public AndTestBuilder(ApiController controller, string actionName, TActionResult actionResult)
1323
: base(controller, actionName, actionResult)
1424
{
1525
}
1626

27+
/// <summary>
28+
/// Method allowing additional assertions after the model state tests.
29+
/// </summary>
30+
/// <returns>Builder for testing the action result.</returns>
1731
public IActionResultTestBuilder<TActionResult> And()
1832
{
1933
return new ActionResultTestBuilder<TActionResult>(this.Controller, this.ActionName, this.ActionResult);

MyWebApi/Builders/Base/BaseTestBuilderWithActionResult.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ protected TResponseModel GetActualModel<TResponseModel>()
6969
}
7070
}
7171

72+
/// <summary>
73+
/// Initializes new instance of builder providing And method.
74+
/// </summary>
75+
/// <returns>Test builder with And method.</returns>
7276
protected IAndTestBuilder<TActionResult> NewAndTestBuilder()
7377
{
7478
return new AndTestBuilder<TActionResult>(this.Controller, this.ActionName, this.ActionResult);

MyWebApi/Builders/Contracts/Actions/IActionResultTestBuilder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ public interface IActionResultTestBuilder<out TActionResult> : IBaseTestBuilderW
2525
/// <summary>
2626
/// Checks whether the tested action's provided model state is valid.
2727
/// </summary>
28+
/// <returns>Test builder with And method.</returns>
2829
IAndTestBuilder<TActionResult> ShouldHaveValidModelState();
2930

3031
/// <summary>
3132
/// Checks whether the tested action's provided model state is not valid.
3233
/// </summary>
34+
/// <returns>Test builder with And method.</returns>
3335
IAndTestBuilder<TActionResult> ShouldHaveInvalidModelState();
3436

3537
/// <summary>

MyWebApi/Builders/Contracts/And/IAndTestBuilder.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
{
33
using Actions;
44

5+
/// <summary>
6+
/// Class containing And() method allowing additional assertions after model state tests.
7+
/// </summary>
8+
/// <typeparam name="TActionResult">Result from invoked action in ASP.NET Web API controller.</typeparam>
59
public interface IAndTestBuilder<out TActionResult>
610
{
11+
/// <summary>
12+
/// Method allowing additional assertions after the model state tests.
13+
/// </summary>
14+
/// <returns>Builder for testing the action result.</returns>
715
IActionResultTestBuilder<TActionResult> And();
816
}
917
}

0 commit comments

Comments
 (0)