GlobalExceptionHandlerDotNet icon indicating copy to clipboard operation
GlobalExceptionHandlerDotNet copied to clipboard

How to handle the response in unit test cases?

Open srivatsahg opened this issue 3 years ago • 0 comments

Hello How can I handle the exceptions deliberately thrown from the controller using MediatR in UT cases

Ex: This code snippet expects an ArgumentException from the controller side

command.CustomerProfileId = id; await _mediator.Send(command); return Ok();

The line await _mediator.Send(command); throws NullReference Exception.

srivatsahg avatar Nov 26 '21 08:11 srivatsahg