|
2 | 2 | {
|
3 | 3 | using System;
|
4 | 4 | using System.Linq.Expressions;
|
| 5 | + using System.Threading.Tasks; |
5 | 6 | using Builders.Contracts.Actions;
|
6 | 7 | using Builders.Contracts.Controllers;
|
7 | 8 | using Builders.Controllers;
|
@@ -73,6 +74,35 @@ public static IControllerBuilder<TController> Instance(Func<TController> constru
|
73 | 74 | /// <param name="actionCall">Method call expression indicating invoked action.</param>
|
74 | 75 | /// <returns>Test builder of <see cref="IActionResultTestBuilder{TActionResult}"/> type.</returns>
|
75 | 76 | public new static IActionResultTestBuilder<TActionResult> Calling<TActionResult>(Expression<Func<TController, TActionResult>> actionCall)
|
76 |
| - => Instance().Calling(actionCall); |
| 77 | + => Instance() |
| 78 | + .Calling(actionCall); |
| 79 | + |
| 80 | + /// <summary> |
| 81 | + /// Indicates which action should be invoked and tested. |
| 82 | + /// </summary> |
| 83 | + /// <typeparam name="TActionResult">Type of result from action.</typeparam> |
| 84 | + /// <param name="actionCall">Method call expression indicating invoked asynchronous action.</param> |
| 85 | + /// <returns>Test builder of <see cref="IActionResultTestBuilder{TActionResult}"/> type.</returns> |
| 86 | + public new static IActionResultTestBuilder<TActionResult> Calling<TActionResult>(Expression<Func<TController, Task<TActionResult>>> actionCall) |
| 87 | + => Instance() |
| 88 | + .Calling(actionCall); |
| 89 | + |
| 90 | + /// <summary> |
| 91 | + /// Indicates which action should be invoked and tested. |
| 92 | + /// </summary> |
| 93 | + /// <param name="actionCall">Method call expression indicating invoked void action.</param> |
| 94 | + /// <returns>Test builder of <see cref="IActionResultTestBuilder{TActionResult}"/> type.</returns> |
| 95 | + public new static IVoidActionResultTestBuilder Calling(Expression<Action<TController>> actionCall) |
| 96 | + => Instance() |
| 97 | + .Calling(actionCall); |
| 98 | + |
| 99 | + /// <summary> |
| 100 | + /// Indicates which action should be invoked and tested. |
| 101 | + /// </summary> |
| 102 | + /// <param name="actionCall">Method call expression indicating invoked asynchronous void action.</param> |
| 103 | + /// <returns>Test builder of <see cref="IActionResultTestBuilder{TActionResult}"/> type.</returns> |
| 104 | + public new static IVoidActionResultTestBuilder Calling(Expression<Func<TController, Task>> actionCall) |
| 105 | + => Instance() |
| 106 | + .Calling(actionCall); |
77 | 107 | }
|
78 | 108 | }
|
0 commit comments