public async Task ShouldUpdateValidationInvalid()
        {
            var pluginsViewModel = new UpdateSolutionPluginsViewModel();

            var validationModel = new RequiredMaxLengthResult()
            {
                Required  = { "plugins-required" },
                MaxLength = { "plugins-detail" }
            };

            _mockMediator.Setup(m =>
                                m.Send(
                                    It.Is <UpdateSolutionPluginsCommand>(q =>
                                                                         q.SolutionId == SolutionId && q.UpdateSolutionPluginsViewModel == pluginsViewModel),
                                    It.IsAny <CancellationToken>())).ReturnsAsync(validationModel);

            var result = (await _plugInsController.UpdatePlugInsAsync(SolutionId, pluginsViewModel).ConfigureAwait(false)) as BadRequestObjectResult;

            result.StatusCode.Should().Be((int)HttpStatusCode.BadRequest);
            (result.Value as UpdateFormRequiredMaxLengthResult).Required.Should().BeEquivalentTo(new[] { "plugins-required" });
            (result.Value as UpdateFormRequiredMaxLengthResult).MaxLength.Should().BeEquivalentTo(new[] { "plugins-detail" });

            _mockMediator.Verify(
                m => m.Send(
                    It.Is <UpdateSolutionPluginsCommand>(q =>
                                                         q.SolutionId == SolutionId && q.UpdateSolutionPluginsViewModel ==
                                                         pluginsViewModel), It.IsAny <CancellationToken>()), Times.Once);
        }
        public async Task ShouldUpdateValidationValid()
        {
            var pluginsViewModel = new UpdateSolutionPluginsViewModel();

            var validationModel = new RequiredMaxLengthResult();

            _mockMediator
            .Setup(m => m.Send(
                       It.Is <UpdateSolutionPluginsCommand>(q =>
                                                            q.SolutionId == SolutionId && q.UpdateSolutionPluginsViewModel == pluginsViewModel),
                       It.IsAny <CancellationToken>())).ReturnsAsync(validationModel);

            var result = (await _plugInsController.UpdatePlugInsAsync(SolutionId, pluginsViewModel).ConfigureAwait(false)) as NoContentResult;

            result?.StatusCode.Should().Be((int)HttpStatusCode.NoContent);

            _mockMediator.Verify(
                m => m.Send(
                    It.Is <UpdateSolutionPluginsCommand>(q =>
                                                         q.SolutionId == SolutionId && q.UpdateSolutionPluginsViewModel ==
                                                         pluginsViewModel), It.IsAny <CancellationToken>()), Times.Once);
        }
 public async Task <ActionResult> UpdatePlugInsAsync([FromRoute][Required] string id, [FromBody][Required] UpdateSolutionPluginsViewModel updateSolutionPlugInsViewModel) =>
 (await _mediator.Send(new UpdateSolutionPluginsCommand(id, updateSolutionPlugInsViewModel)).ConfigureAwait(false)).ToActionResult();