2 years ago

#74888

test-img

MaT

unit testing controller action with call multi Mediator.Send command

I have a controller action that use multi mediator, but I don't know to how can I write unit test for this action. help me please

var userObject = await _mediator.Send(new CreateUserCommand(contract),                
            cancellationToken);
var productObject = await _mediator.Send(new CreateProductCommand(contract), 
           cancellationToken);
var userProductObject = await _mediator.Send(new GetUserProductQuery(contract), 
           cancellationToken);

c#

unit-testing

asp.net-core

integration-testing

mediator

0 Answers

Your Answer

Accepted video resources