Skip to content

Commit 93399ac

Browse files
committed
Added ActionResultOfTTestBuilder (#359)
1 parent bbaf748 commit 93399ac

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed
Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
namespace MyTested.AspNetCore.Mvc.Builders.ActionResults.ActionResult
22
{
3-
public class ActionResultOfTTestBuilder
3+
using Builders.Base;
4+
using Contracts.ActionResults.ActionResult;
5+
using Internal.TestContexts;
6+
7+
/// <summary>
8+
/// Used for testing <see cref="Microsoft.AspNetCore.Mvc.ActionResult{TResult}"/>.
9+
/// </summary>
10+
/// <typeparam name="TResult">Type of the expected result.</typeparam>
11+
public class ActionResultOfTTestBuilder<TResult>
12+
: BaseTestBuilderWithActionResult<TResult>,
13+
IAndActionResultOfTTestBuilder<TResult>
414
{
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="ActionResultOfTTestBuilder{TResult}"/> class.
17+
/// </summary>
18+
/// <param name="testContext">
19+
/// <see cref="ControllerTestContext"/> containing data about the currently executed assertion chain.
20+
/// </param>
21+
public ActionResultOfTTestBuilder(ControllerTestContext testContext)
22+
: base(testContext)
23+
{
24+
}
25+
26+
/// <inheritdoc />
27+
public IActionResultOfTTestBuilder<TResult> AndAlso() => this;
528
}
629
}

src/MyTested.AspNetCore.Mvc.Controllers/Builders/Contracts/ActionResults/ActionResult/IAndActionResultOfTTestBuilder.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/// </summary>
77
/// <typeparam name="TResult">Type of the expected result.</typeparam>
88
public interface IAndActionResultOfTTestBuilder<TResult>
9+
: IActionResultOfTTestBuilder<TResult>
910
{
1011
/// <summary>
1112
/// AndAlso method for better readability when

0 commit comments

Comments
 (0)