Beispiel #1
0
        public async Task NullClientApplicationShouldReturnNull()
        {
            _mediatorMock.Setup(x => x.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == _solutionId), It.IsAny <CancellationToken>()))
            .ReturnsAsync(null as IClientApplication);

            var result = (await _nativeDesktopConnectivityDetailsController.GetConnectivity(_solutionId).ConfigureAwait(false)) as ObjectResult;

            result.StatusCode.Should().Be((int)HttpStatusCode.OK);
            result.Value.Should().BeOfType <GetNativeDesktopConnectivityDetailsResult>();
            var connectivityResult = result.Value as GetNativeDesktopConnectivityDetailsResult;

            connectivityResult.NativeDesktopMinimumConnectionSpeed.Should().BeNull();
        }
        public async Task NullClientApplicationShouldReturnNull()
        {
            mediatorMock
                .Setup(m => m.Send(
                    It.Is<GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId),
                    It.IsAny<CancellationToken>()))
                .ReturnsAsync(null as IClientApplication);

            var result = await nativeDesktopConnectivityDetailsController.GetConnectivity(SolutionId) as ObjectResult;

            Assert.NotNull(result);
            result.StatusCode.Should().Be(StatusCodes.Status200OK);
            result.Value.Should().BeOfType<GetNativeDesktopConnectivityDetailsResult>();
            result.Value.As<GetNativeDesktopConnectivityDetailsResult>().NativeDesktopMinimumConnectionSpeed.Should().BeNull();
        }