public async Task ShouldReturnNotFound()
        {
            var result = (await _nativeMobileController.GetNativeMobileAsync(SolutionId).ConfigureAwait(false)) as NotFoundResult;

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

            _mockMediator.Verify(
                m => m.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>()),
                Times.Once);
        }
예제 #2
0
        public async Task ShouldReturnEmpty()
        {
            var result = await nativeMobileController.GetNativeMobileAsync(SolutionId) as ObjectResult;

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

            var nativeMobileResult = result.Value as NativeMobileResult;

            Assert.NotNull(nativeMobileResult);
            nativeMobileResult.Should().NotBeNull();
            nativeMobileResult.NativeMobileSections.Should().NotBeNull();

            var mobileOperatingSystems = nativeMobileResult.NativeMobileSections.MobileOperatingSystems;

            AssertSectionMandatoryAndComplete(mobileOperatingSystems, true, false);

            var mobileFirst = nativeMobileResult.NativeMobileSections.MobileFirst;

            AssertSectionMandatoryAndComplete(mobileFirst, true, false);

            var mobileMemoryStorage = nativeMobileResult.NativeMobileSections.MobileMemoryStorage;

            AssertSectionMandatoryAndComplete(mobileMemoryStorage, true, false);

            var mobileConnectionDetails = nativeMobileResult.NativeMobileSections.MobileConnectionDetails;

            AssertSectionMandatoryAndComplete(mobileConnectionDetails, false, false);

            var mobileComponentDeviceCapabilities =
                nativeMobileResult.NativeMobileSections.MobileComponentsDeviceCapabilities;

            AssertSectionMandatoryAndComplete(mobileComponentDeviceCapabilities, false, false);

            var mobileHardwareRequirements = nativeMobileResult.NativeMobileSections.MobileHardwareRequirements;

            AssertSectionMandatoryAndComplete(mobileHardwareRequirements, false, false);

            var mobileThirdParty = nativeMobileResult.NativeMobileSections.MobileThirdPartySection;

            AssertSectionMandatoryAndComplete(mobileThirdParty, false, false);

            var mobileAdditionalInformation = nativeMobileResult.NativeMobileSections.MobileAdditionalInformation;

            AssertSectionMandatoryAndComplete(mobileAdditionalInformation, false, false);
        }