public void When_UpdateImageTagsIsExecutedWithValidModel_CommandIsSent() { var input = new UpdateImageTagsInput() { Tags = new[] { "1", "2" } }; Controller._UpdateImageTags("imageId", input); CommandInvokerMock.Verify(x => x.Execute(It.Is <UpdateImageTagsCommand>( y => y.Tags[0] == "1" && y.Tags[1] == "2" && y.ImageId == "imageId")), Times.Once()); }
public ActionResult _UpdateImageTags(string imageId, UpdateImageTagsInput input) { if (ModelState.IsValid) { commandInvoker.Execute(new UpdateImageTagsCommand( imageId, input.Tags)); return(Json(new { Success = true })); } else { return(Json(new { Success = false })); } }