/// <summary> /// Initialises a new instance of the <see cref="BrowsersSupportedSectionAnswers"/> class. /// </summary> public BrowsersSupportedSectionAnswers(IClientApplication clientApplication) { bool?mobileResponsive = clientApplication?.MobileResponsive; SupportedBrowsers = clientApplication?.BrowsersSupported?.Any() == true ? clientApplication?.BrowsersSupported : null; MobileResponsive = mobileResponsive.ToYesNoString(); }
/// <summary> /// Initialises a new instance of the <see cref="GetBrowsersSupportedResult"/> class. /// </summary> public GetBrowsersSupportedResult(IClientApplication clientApplication) { bool?clientApplicationMobileResponsive = clientApplication?.MobileResponsive; BrowsersSupported = clientApplication?.BrowsersSupported ?? new HashSet <string>(); MobileResponsive = clientApplicationMobileResponsive.ToYesNoString(); }
public MobileOperatingSystemsSectionAnswers(IClientApplication clientApplication) { OperatingSystems = clientApplication?.MobileOperatingSystems?.OperatingSystems?.Any() == true ? clientApplication.MobileOperatingSystems?.OperatingSystems : null; OperatingSystemsDescription = clientApplication?.MobileOperatingSystems?.OperatingSystemsDescription; }
/// <summary> /// Initialises a new instance of the <see cref="BrowserBasedSubSections"/> class. /// </summary> internal BrowserBasedSubSections(IClientApplication clientApplication) { BrowsersSupported = new BrowsersSupportedSection(clientApplication); PluginOrExtensionsSection = new PluginOrExtensionsSection(clientApplication); BrowserHardwareRequirementsSection = new BrowserHardwareRequirementsSection(clientApplication); BrowserAdditionalInformationSection = new BrowserAdditionalInformationSection(clientApplication); BrowserConnectivityAndResolutionSection = new BrowserConnectivityAndResolutionSection(clientApplication); BrowserMobileFirstSection = new BrowserMobileFirstSection(clientApplication); }
public ClientApplicationTypesSubSections(IClientApplication clientApplication) { BrowserBased = clientApplication?.ClientApplicationTypes?.Contains("browser-based") == true ? new BrowserBasedSection(clientApplication).IfPopulated() : null; NativeMobile = clientApplication?.ClientApplicationTypes?.Contains("native-mobile") == true ? new NativeMobileSection(clientApplication).IfPopulated() : null; }
public NativeDesktopSections(IClientApplication clientApplication) { OperatingSystems = DashboardSection.Mandatory(clientApplication.IsNativeDesktopOperatingSystemsComplete()); ConnectionDetails = DashboardSection.Mandatory(clientApplication.IsNativeDesktopConnectionDetailsComplete()); MemoryAndStorage = DashboardSection.Mandatory(clientApplication.IsNativeDesktopMemoryAndStorageComplete()); ThirdParty = DashboardSection.Optional(clientApplication.IsNativeDesktopThirdPartyComplete()); HardwareRequirements = DashboardSection.Optional(!string.IsNullOrWhiteSpace(clientApplication?.NativeDesktopHardwareRequirements)); AdditionalInformation = DashboardSection.Optional(!string.IsNullOrWhiteSpace(clientApplication?.NativeDesktopAdditionalInformation)); }
public InventarioApp(IClientApplication app) { this.idEmpresa = Guid.Empty; this.app = app; this.guid = new SequentialGuid(); this.animales = this.GetListaDeAnimales(); this.sucursales = this.GetListaDeSucursales(); }
/// <summary> /// Initialises a new instance of the <see cref="BrowserBasedDashboardSections"/> class. /// </summary> public BrowserBasedDashboardSections(IClientApplication clientApplication) { BrowsersSupportedSection = new BrowserBasedDashboardSection(clientApplication.IsBrowserSupportedComplete(), true); BrowserMobileFirstSection = new BrowserBasedDashboardSection(clientApplication.IsMobileFirstComplete(), true); PluginsOrExtensionsSection = new BrowserBasedDashboardSection(clientApplication.IsPluginsComplete(), true); ConnectivityAndResolutionSection = new BrowserBasedDashboardSection(clientApplication.IsConnectivityAndResolutionComplete(), true); HardwareRequirementsSection = new BrowserBasedDashboardSection(clientApplication.IsHardwareRequirementComplete(), false); BrowserAdditionalInformationSection = new BrowserBasedDashboardSection(clientApplication.IsAdditionalInformationComplete(), false); }
public TelemetryService(IClientApplication clientApp) { _clientApp = clientApp; _plsVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); #if DEBUG _plsVersion += "-debug"; // Add a suffix so we can more easily ignore non-release versions. #endif }
internal NativeDesktopSubSections(IClientApplication clientApplication) { HardwareRequirementsSection = new NativeDesktopHardwareRequirementsSection(clientApplication); OperatingSystemsSection = new NativeDesktopOperatingSystemsSection(clientApplication); NativeDesktopConnectivityDetailsSection = new NativeDesktopConnectivityDetailsSection(clientApplication); NativeDesktopThirdPartySection = new NativeDesktopThirdPartySection(clientApplication); NativeDesktopMemoryAndStorageSection = new NativeDesktopMemoryAndStorageSection(clientApplication); NativeDesktopAdditionalInformationSection = new NativeDesktopAdditionalInformationSection(clientApplication); }
/// <summary> /// Initialises a new instance of the <see cref="ClientApplicationTypesSubSections"/> class. /// </summary> /// <param name="clientApplication"></param> public ClientApplicationTypesSubSections(IClientApplication clientApplication) { HashSet <string> clientApplicationTypes = clientApplication?.ClientApplicationTypes ?? new HashSet <string>(); SetIfSelected("browser-based", clientApplicationTypes, () => BrowserBasedSection = DashboardSection.Mandatory(clientApplication.IsBrowserBasedComplete())); SetIfSelected("native-mobile", clientApplicationTypes, () => NativeMobileSection = DashboardSection.Mandatory(false)); SetIfSelected("native-desktop", clientApplicationTypes, () => NativeDesktopSection = DashboardSection.Mandatory(false)); }
internal NativeMobileSubSections(IClientApplication clientApplication) { MobileOperatingSystemsSection = new MobileOperatingSystemsSection(clientApplication); NativeMobileFirstSection = new NativeMobileFirstSection(clientApplication); MobileConnectionDetailsSection = new MobileConnectionDetailsSection(clientApplication); MobileMemoryAndStorageSection = new MobileMemoryAndStorageSection(clientApplication); HardwareRequirementsSection = new MobileHardwareRequirementsSection(clientApplication); MobileThirdPartySection = new MobileThirdPartySection(clientApplication); MobileAdditionalInformationSection = new MobileAdditionalInformationSection(clientApplication); }
public void WhenGetClientApplicationWithKnownId_ThenReturnsApp() { var app = new Mock <IClientApplication>(); storageProvider.Setup(sp => sp.Get(It.IsAny <string>())).Returns(app.Object); IClientApplication result = clientManager.GetClientApplication("foo"); Assert.Equal(app.Object, result); }
public NativeMobileSections(IClientApplication clientApplication) { MobileOperatingSystems = DashboardSection.Mandatory(clientApplication.IsMobileOperatingSystems()); MobileFirst = DashboardSection.Mandatory(clientApplication.IsNativeMobileFirstComplete()); MobileMemoryStorage = DashboardSection.Mandatory(clientApplication.IsMobileMemoryAndStorageComplete()); MobileConnectionDetails = DashboardSection.Optional(clientApplication.IsMobileConnectionDetailsComplete()); MobileComponentsDeviceCapabilities = DashboardSection.Optional(false); MobileHardwareRequirements = DashboardSection.Optional(false); MobileAdditionalInformation = DashboardSection.Optional(false); }
public void WhenCreateClientApplicationWithNewName_ThenCreatesNewApp() { storageProvider.Setup(sp => sp.Get(It.IsAny <string>())).Returns((IClientApplication)null); IClientApplication result = clientManager.CreateClientApplication("foo"); storageProvider.Verify(sp => sp.Add(It.IsAny <IClientApplication>()), Times.Once()); Assert.NotNull(result); Assert.Equal("foo", result.Name); Assert.False(!result.ClientIdentifier.HasValue()); Assert.False(!result.ClientSecret.HasValue()); }
public void WhenRegisterClientApplicationWithExistingIdentifier_ThenReturnsNull() { var app = new Mock <IClientApplication>(); storageProvider.Setup(sp => sp.Find(It.IsAny <string>())).Returns(new[] { app.Object }); IClientApplication result = clientManager.RegisterClientApplication(new ClientApplication()); Assert.Null(result); }
/// <summary> /// Returns the specified client from the store. /// </summary> public IClientDescription GetClient(string clientIdentifier) { Guard.NotNullOrEmpty(() => clientIdentifier, clientIdentifier); IClientApplication clientApp = ClientApplicationsManager.GetClientApplicationByClientIdentifier(clientIdentifier); if (clientApp != null) { return(new ClientDescription(clientApp.ClientSecret, null, ClientType.Confidential)); } return(null); }
private async Task <NativeMobileResult> GetNativeMobileSectionAsync(IClientApplication clientApplication) { mockMediator.Setup( m => m.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>())) .ReturnsAsync(clientApplication); var result = await nativeMobileController.GetNativeMobileAsync(SolutionId) as ObjectResult; result?.StatusCode.Should().Be(StatusCodes.Status200OK); mockMediator.Verify( m => m.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>())); return(result?.Value as NativeMobileResult); }
private async Task <BrowserBasedResult> GetBrowserBasedSectionAsync(IClientApplication clientApplication) { _mockMediator.Setup(m => m.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>())) .ReturnsAsync(clientApplication); var result = (await _browserBasedController.GetBrowserBasedAsync(SolutionId).ConfigureAwait(false)) as ObjectResult; result.StatusCode.Should().Be((int)HttpStatusCode.OK); _mockMediator.Verify( m => m.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>()), Times.Once); return(result.Value as BrowserBasedResult); }
public void Setup() { _mockMediator = new Mock <IMediator>(); _mockMediator.Setup(x => x.Send(It.Is <UpdateSolutionConnectivityAndResolutionCommand>(command => command.Id == SolutionId), It.IsAny <CancellationToken>())) .ReturnsAsync(() => _validationResult); _clientApplication = Mock.Of <IClientApplication>(c => c.MinimumConnectionSpeed == "1 PPH" && c.MinimumDesktopResolution == "1x1"); _mockMediator.Setup(x => x.Send(It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>())) .ReturnsAsync(() => _clientApplication); _controller = new ConnectivityAndResolutionController(_mockMediator.Object); _validationResult = new RequiredResult(); _viewModel = new UpdateSolutionConnectivityAndResolutionViewModel { MinimumConnectionSpeed = "1 PPH (Pigeon Per Hour)", MinimumDesktopResolution = "1x1" }; }
/// <summary> /// 初始化数据访问组件 /// </summary> public void Init() { if (netEP != null && (netEP.IpAddress != ClientConfig.ServerIP || netEP.TcpPort != ClientConfig.ServerPort)) { if (dataClient != null && dataClient.CommunicationState == Net.Communication.CommunicationStates.Connected) { dataClient.Disconnect(); } } netEP = new CJiaEndPoint(ClientConfig.ServerIP, ClientConfig.ServerPort); dataClient = CJiaClientBuilder.CreateClientApplication <CJia.Net.Service.IDataAdapter>(netEP); dataClient.Timeout = 6000 * 10; //三分钟超时 dataClient.AllowAutoPing = false; dataClient.PingInterval = 30000; //30秒 dataClient.Connect(); dataClient.ServiceProxy.Init(ClientCode, DbName); }
public DiagnosticsService(IServiceContainer services) { _services = services; _clientApp = services.GetService <IClientApplication>(); var idleTimeService = services.GetService <IIdleTimeService>(); if (idleTimeService != null) { idleTimeService.Idle += OnIdle; idleTimeService.Closing += OnClosing; _disposables .Add(() => idleTimeService.Idle -= OnIdle) .Add(() => idleTimeService.Idle -= OnClosing); } }
public void WhenRegisterClientApplicationWithNewApplication_ThenRegistersNewApp() { storageProvider.Setup(sp => sp.Get(It.IsAny <string>())).Returns((IClientApplication)null); IClientApplication result = clientManager.RegisterClientApplication(new ClientApplication { Name = "foo", ClientIdentifier = "bar", ClientSecret = "bar2", }); storageProvider.Verify(sp => sp.Add(It.IsAny <IClientApplication>()), Times.Once()); Assert.NotNull(result); Assert.Equal(@"foo", result.Name); Assert.Equal(@"bar", result.ClientIdentifier); Assert.Equal(@"bar2", result.ClientSecret); }
private async Task <BrowserBasedResult> GetBrowserBasedSectionAsync(IClientApplication clientApplication) { mockMediator .Setup(m => m.Send( It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>())) .ReturnsAsync(clientApplication); var result = (await browserBasedController.GetBrowserBasedAsync(SolutionId)) as ObjectResult; Assert.NotNull(result); result.StatusCode.Should().Be(StatusCodes.Status200OK); mockMediator.Verify(m => m.Send( It.Is <GetClientApplicationBySolutionIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>())); return(result.Value as BrowserBasedResult); }
/// <summary> /// Initialises a new instance of the <see cref="ClientApplicationTypesSection"/> class. /// </summary> public ClientApplicationTypesSection(IClientApplication clientApplication) { Sections = new ClientApplicationTypesSubSections(clientApplication); }
public BrowserMobileFirstSectionAnswers(IClientApplication clientApplication) =>
public MobileThirdPartySection(IClientApplication clientApplication) { Answers = new MobileThirdSectionAnswers(clientApplication?.MobileThirdParty); }
public MobileConnectionDetailsSection(IClientApplication clientApplication) { Answers = new MobileConnectionDetailsSectionAnswers(clientApplication?.MobileConnectionDetails); }
public NativeDesktopAdditionalInformationSection(IClientApplication clientApplication) =>
internal NativeDesktopMemoryAndStorageSection(IClientApplication clientApplication) { Answers = new NativeDesktopMemoryAndStorageSectionAnswers(clientApplication.NativeDesktopMemoryAndStorage); }