public void GetBasicInformationTests() { var info = new SystemInformationService().GetBasicInformation(); Assert.IsNotNull(info.MachineName); Assert.IsNotNull(info.OperatingSystem); Assert.IsNotNull(info.OperatingSystemArchitecture); Assert.IsNotNull(info.OperatingSystemVersion); Assert.IsNotNull(info.OperatingSystemLanguage); Assert.IsNotNull(info.Manufacturer); Assert.IsNotNull(info.Model); Assert.IsTrue(info.Processors.Length > 0); foreach (var p in info.Processors) { Assert.IsNotNull(p); } Assert.AreNotEqual(0, info.Memory); Assert.AreNotEqual(0, info.MachineName); Assert.IsTrue(info.VideoControllers.Length > 0); foreach (var vc in info.VideoControllers) { Assert.IsNotNull(vc.Name); } }
public ActionResult <String> Get() { var os = new SystemInformationService().GetOperationSystemInformationService(); string output = JsonConvert.SerializeObject(os); return(output.ToString()); }
public SystemInformationController(ILogger <SystemInformationController> logger, ServiceFacade.Controller context, SystemInformationService systemInformationService) : base(context) { _logger = Require.IsNotNull(logger, nameof(logger)); _systemInformationService = Require.IsNotNull(systemInformationService, nameof(systemInformationService)); }
public SystemInformationController(ILogger <SystemInformationController> logger, ServiceFacade.Controller context, IOptions <RequestLocalizationOptions> l10nOptions, SystemInformationService systemInformationService) : base(context) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _l10nOptions = l10nOptions ?? throw new ArgumentNullException(nameof(l10nOptions)); _systemInformationService = systemInformationService ?? throw new ArgumentNullException(nameof(systemInformationService)); }
/// <summary> /// Manipulates the composition container. /// </summary> /// <param name="compositionContainer">The composition container.</param> private void ManipulateCompositionContainer(CompositionContainer compositionContainer) { compositionContainer.ComposeExportedValue <IScheduler>( new SynchronizationContextScheduler(SynchronizationContext.Current)); var systemInfoService = new SystemInformationService(); compositionContainer.ComposeExportedValue <ISystemInformationService>(systemInfoService); Selector = compositionContainer.GetExportedValue <LauncherSelector>(); }
public TestController() { Log.Instance = new TestLogger(); // Create root services first. var systemInformationService = new SystemInformationService(); var apiService = new ApiService(); ApiService = new ApiService(); BackupService = new BackupService(); StorageService = new StorageService(); TimerService = new TestTimerService(); DaylightService = new TestDaylightService(); DateTimeService = new TestDateTimeService(); SettingsService = new SettingsService(BackupService, StorageService); ResourceService = new ResourceService(BackupService, StorageService, SettingsService); SchedulerService = new SchedulerService(TimerService, DateTimeService); NotificationService = new NotificationService(DateTimeService, ApiService, SchedulerService, SettingsService, StorageService, ResourceService); SystemEventsService = new SystemEventsService(this, NotificationService, ResourceService); AutomationService = new AutomationService(SystemEventsService, systemInformationService, apiService); ComponentService = new ComponentService(SystemEventsService, systemInformationService, apiService, SettingsService); AreaService = new AreaService(ComponentService, AutomationService, SystemEventsService, systemInformationService, apiService, SettingsService); }