示例#1
0
        public async Task PopulatedHardwareDetailsShouldReturnHardwareDetails(string hardwareRequirements)
        {
            _mediatorMock.Setup(x => x.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == _solutionId), It.IsAny <CancellationToken>()))
            .ReturnsAsync(Mock.Of <IClientApplication>(c =>
                                                       c.NativeDesktopHardwareRequirements == hardwareRequirements));

            var result = await _controller.GetHardwareRequirements(_solutionId).ConfigureAwait(false) as ObjectResult;

            result.Should().NotBeNull();
            result.StatusCode.Should().Be((int)HttpStatusCode.OK);
            result.Value.Should().BeOfType <GetNativeDesktopHardwareRequirementsResult>();
            var hardwareResult = result.Value as GetNativeDesktopHardwareRequirementsResult;

            hardwareResult.HardwareRequirements.Should().Be(hardwareRequirements);
        }
示例#2
0
        public async Task PopulatedHardwareDetailsShouldReturnHardwareDetails(string hardwareRequirements)
        {
            mediatorMock
            .Setup(m => m.Send(
                       It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId),
                       It.IsAny <CancellationToken>()))
            .ReturnsAsync(Mock.Of <IClientApplication>(c => c.NativeDesktopHardwareRequirements == hardwareRequirements));

            var result = await controller.GetHardwareRequirements(SolutionId) as ObjectResult;

            Assert.NotNull(result);
            result.StatusCode.Should().Be(StatusCodes.Status200OK);
            result.Value.Should().BeOfType <GetNativeDesktopHardwareRequirementsResult>();

            var hardwareResult = result.Value as GetNativeDesktopHardwareRequirementsResult;

            Assert.NotNull(hardwareResult);
            hardwareResult.HardwareRequirements.Should().Be(hardwareRequirements);
        }