GlobalExceptionHandlerDotNet
GlobalExceptionHandlerDotNet copied to clipboard
How to handle the response in unit test cases?
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.