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.NativeMobileHardwareRequirements == 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 <GetHardwareRequirementsResult>(); var hardwareResult = result.Value as GetHardwareRequirementsResult; hardwareResult.HardwareRequirements.Should().Be(hardwareRequirements); }
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.NativeMobileHardwareRequirements == hardwareRequirements)); var result = await controller.GetHardwareRequirements(SolutionId) as ObjectResult; Assert.NotNull(result); result.StatusCode.Should().Be(StatusCodes.Status200OK); result.Value.Should().BeOfType <GetHardwareRequirementsResult>(); var hardwareResult = result.Value as GetHardwareRequirementsResult; Assert.NotNull(hardwareResult); hardwareResult.HardwareRequirements.Should().Be(hardwareRequirements); }