Skip to content

Commit f62c150

Browse files
committed
Implemented .ShouldReturn().ActionResult() (#359)
1 parent f45cf70 commit f62c150

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/MyTested.AspNetCore.Mvc.Controllers/Builders/Actions/ShouldReturn/ShouldReturnActionResultTestBuilder.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
namespace MyTested.AspNetCore.Mvc.Builders.Actions.ShouldReturn
22
{
3+
using And;
34
using Contracts.Actions;
45
using Contracts.And;
56
using Internal.TestContexts;
7+
using Microsoft.AspNetCore.Mvc;
8+
using Utilities.Validators;
69

710
/// <summary>
811
/// Used for testing returned <see cref="Microsoft.AspNetCore.Mvc.ActionResult"/>.
@@ -23,8 +26,12 @@ public ShouldReturnActionResultTestBuilder(ControllerTestContext testContext)
2326
/// <inheritdoc />
2427
public new IAndTestBuilder ActionResult()
2528
{
26-
var result = base.ActionResult;
27-
throw new System.NotImplementedException();
29+
InvocationResultValidator.ValidateInvocationResultTypes(
30+
this.TestContext,
31+
canBeAssignable: true,
32+
typesOfExpectedReturnValue: new [] { typeof(IActionResult), typeof(ActionResult<>) });
33+
34+
return new AndTestBuilder(this.TestContext);
2835
}
2936
}
3037
}

0 commit comments

Comments
 (0)