File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/MyTested.AspNetCore.Mvc.Controllers/Builders/Actions/ShouldReturn Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
namespace MyTested . AspNetCore . Mvc . Builders . Actions . ShouldReturn
2
2
{
3
3
using System ;
4
+ using ActionResults . ActionResult ;
4
5
using And ;
6
+ using Contracts . ActionResults . ActionResult ;
5
7
using Contracts . Actions ;
6
8
using Contracts . And ;
7
9
using Internal . TestContexts ;
@@ -46,13 +48,15 @@ public ShouldReturnActionResultTestBuilder(ControllerTestContext testContext)
46
48
return new AndTestBuilder ( this . TestContext ) ;
47
49
}
48
50
51
+ /// <inheritdoc />
49
52
public new IAndTestBuilder ActionResult < TResult > ( )
50
53
{
51
54
this . ValidateActionResult < TResult > ( ) ;
52
55
53
56
return new AndTestBuilder ( this . TestContext ) ;
54
57
}
55
58
59
+ /// <inheritdoc />
56
60
public new IAndTestBuilder ActionResult < TResult > (
57
61
Action < IShouldReturnTestBuilder < TActionResult > > actionResultTestBuilder )
58
62
{
@@ -63,6 +67,16 @@ public ShouldReturnActionResultTestBuilder(ControllerTestContext testContext)
63
67
return new AndTestBuilder ( this . TestContext ) ;
64
68
}
65
69
70
+ /// <inheritdoc />
71
+ public new IAndTestBuilder ActionResult < TResult > ( Action < IActionResultOfTTestBuilder < TResult > > actionResultTestBuilder )
72
+ {
73
+ this . ValidateActionResult < TResult > ( ) ;
74
+
75
+ actionResultTestBuilder ? . Invoke ( new ActionResultOfTTestBuilder < TResult > ( this . TestContext ) ) ;
76
+
77
+ return new AndTestBuilder ( this . TestContext ) ;
78
+ }
79
+
66
80
private void ValidateActionResults ( )
67
81
=> InvocationResultValidator . ValidateInvocationResultTypes (
68
82
this . TestContext ,
You can’t perform that action at this time.
0 commit comments