public async Task InsertDeliveryDate_InvokeExpectedMethods() { await _service.InsertDeliveryDate(new DeliveryDate()); _repositoryMock.Verify(c => c.InsertAsync(It.IsAny <DeliveryDate>()), Times.Once); _mediatorMock.Verify(c => c.Publish(It.IsAny <EntityInserted <DeliveryDate> >(), default(CancellationToken)), Times.Once); }
public async Task <IActionResult> CreateDeliveryDate(DeliveryDateModel model, bool continueEditing) { if (ModelState.IsValid) { var deliveryDate = model.ToEntity(); await _deliveryDateService.InsertDeliveryDate(deliveryDate); SuccessNotification(_localizationService.GetResource("Admin.Configuration.Shipping.DeliveryDates.Added")); return(continueEditing ? RedirectToAction("EditDeliveryDate", new { id = deliveryDate.Id }) : RedirectToAction("DeliveryDates")); } //If we got this far, something failed, redisplay form return(View(model)); }