public async Task <ActionResult> ProcessPaymentAsync(PaymentDto payment) { try { var result = await _paymentGateway.ProcessAsync(payment); return(Ok(new { Message = result })); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, new { Error = ex.Message })); } }
public async void Should_Not_Process_Null_Value() { // Assert await Assert.ThrowsAsync <ArgumentNullException>(() => _paymentGateway.ProcessAsync(null)); }