コード例 #1
0
        public void service_should_cancel_reservation()
        {
            var reference = "123456";

            _service.CancelReservation(reference);

            _repo.Verify(q => q.CancelReservation(reference), Times.Once);
        }
コード例 #2
0
        public IActionResult Delete(string referenceNumber)
        {
            try
            {
                _service.CancelReservation(referenceNumber);
            }
            catch (RentBadRequest e)
            {
                return(e.Result);
            }
            catch (RentNotFound e)
            {
                return(e.Result);
            }
            catch (Exception e)
            {
                return(StatusCode(500, e));
            }

            return(new OkResult());
        }