public Task <ExceptionResponse> Map(System.Exception exception) { return(exception switch { DomainException ex => _exceptionResponseFactory.Create(ex), AppException ex => _exceptionResponseFactory.Create(ex), InfrastructureException ex => _exceptionResponseFactory.Create(ex), _ => _exceptionResponseFactory.Create("error", "There was an error") });
public async Task Create_CreateExceptionResponseFromAppException_TypeShouldBeExceptionResponse() => (await _factory.Create(new TestException(""))).ShouldBeAssignableTo(typeof(ExceptionResponse));