コード例 #1
0
        public async Task UpdateValidUpdatesRequirements()
        {
            var request = new UpdateNativeDesktopHardwareRequirementsViewModel {
                HardwareRequirements = "New Hardware Requirements"
            };
            var result = (await _controller.UpdateHardwareRequirements(_solutionId, request).ConfigureAwait(false))
                         as NoContentResult;

            result.StatusCode.Should().Be((int)HttpStatusCode.NoContent);
            _mediatorMock.Verify(x => x.Send(
                                     It.Is <UpdateNativeDesktopHardwareRequirementsCommand>(c =>
                                                                                            c.HardwareRequirements == "New Hardware Requirements" &&
                                                                                            c.SolutionId == _solutionId), It.IsAny <CancellationToken>()),
                                 Times.Once);
        }
コード例 #2
0
        public async Task UpdateValidUpdatesRequirements()
        {
            var request = new UpdateNativeDesktopHardwareRequirementsViewModel
            {
                HardwareRequirements = "New Hardware Requirements",
            };

            var result = await controller.UpdateHardwareRequirements(SolutionId, request) as NoContentResult;

            Expression <Func <UpdateNativeDesktopHardwareRequirementsCommand, bool> > match = c =>
                                                                                              c.HardwareRequirements == "New Hardware Requirements" &&
                                                                                              c.SolutionId == SolutionId;

            Assert.NotNull(result);
            result.StatusCode.Should().Be(StatusCodes.Status204NoContent);

            mediatorMock.Verify(m => m.Send(It.Is(match), It.IsAny <CancellationToken>()));
        }