public void CloseAsCanceledTest() { // TODO: add unit test for the method 'CloseAsCanceled' string reservationId = null; // TODO: replace null with proper value CancelReservation cancelReservationContract = null; // TODO: replace null with proper value instance.CloseAsCanceled(reservationId, cancelReservationContract); }
public async Task <IActionResult> Cancel(Guid id) { var command = CancelReservation.Create( id ); await commandBus.Send(command); return(Ok()); }
public void CancelReservationTest() { // TODO: add unit test for the method 'CancelReservation' int? restaurantId = null; // TODO: replace null with proper value string reservationId = null; // TODO: replace null with proper value CancelReservation cancelReservationContract = null; // TODO: replace null with proper value var response = instance.CancelReservation(restaurantId, reservationId, cancelReservationContract); Assert.IsInstanceOf <Reservation> (response, "response is Reservation"); }
public void CancelReservation(CancelReservation cmd) { var date = DateTime.UtcNow; ApplyEvent(new ReservationCanceled() { ReservationId = cmd.ReservationId, Reason = cmd.Reason, CancellationDate = date }); }
public async Task <Unit> Handle(CancelReservation command, CancellationToken cancellationToken) { Guard.Against.Null(command, nameof(command)); var reservation = await repository.Find(command.ReservationId, cancellationToken); reservation.Cancel(); await repository.Update(reservation, cancellationToken); return(Unit.Value); }
public ActionResult Delete(Guid id, String reason) { //var repo = new ReservationRepository(); //repo.DeleteReservation(id); var cmd = new CancelReservation() { ReservationId = id, Reason = reason }; AgileWays.Cqrs.Commands.Writer.ICommandWriter writer = new AzureCommandWriter(); writer.SendCommand(cmd); //CloudHelper.EnqueueCommand(cmd); CloudHelper.LogMessage(1, "Canceled a reservation", "CANCEL"); return(Json(new { isValid = true }, JsonRequestBehavior.AllowGet)); }
static void Main(string[] args) { var theCommand = new CreateReservation() { DiscountCode = "HALF", Name = "David Hoerster", NumberOfSeats = 2, ReservationId = Guid.NewGuid() }; AgileWays.Cqrs.Commands.Writer.ICommandWriter writer = new AgileWays.Cqrs.Commands.Writer.CommandWriter(); writer.SendCommand(theCommand); var cancellation = new CancelReservation() { Reason = "just not that into it anymore", ReservationId = Guid.NewGuid() }; writer.SendCommand(cancellation); }
public ESB_UI(BuiltinHandlerActivator adapter) { InitializeComponent(); Adapter = adapter; cancelReservation = new CancelReservation(Adapter); pnl_Reservation.Controls.Add(cancelReservation); foreach (Control c in pnl_Reservation.Controls) { c.Visible = false; c.Dock = DockStyle.Fill; } sendTransactionalEmail = new SendTransactionalEmail(Adapter); pnl_Email.Controls.Add(sendTransactionalEmail); foreach (Control c in pnl_Email.Controls) { c.Visible = false; c.Dock = DockStyle.Fill; } }
public IEnumerable <object> Cancel(CancelReservation command) { RaiseEvent(new ReservationCanceled(command.Id, command.HotelId, command.RoomType)); return(base.UnCommitedEvents); }
public void TestCancelReservation() { //Testing CancelReservation function CancelReservation cancelReservation = new CancelReservation(); }
public Task HandleAsync(CancelReservation command) => ChangeReservationStatus(command.Id, ReservationStatus.Canceled);
public void Init() { instance = new CancelReservation(); }