public OperativeSystem(IIOTerminal terminal, ISystemInformation systemInformation ) { this.terminal = terminal; this.systemInformation = systemInformation; }
public ServiceInformer( ISystemInformation systemInformation, IIOTerminal terminal ) { this.systemInformation = systemInformation; this.terminal = terminal; }
public ServiceManagerForWindows( IIOTerminal terminal, ISystemInformation systemInformation, IServiceInformer serviceInformer ) { this.terminal = terminal; this.systemInformation = systemInformation; this.serviceInformer = serviceInformer; }
public ServiceManager( IIOTerminal terminal, ISystemInformation systemInformation, IServiceInformer serviceInformer, IServiceManagerFactory serviceManagerFactory ) { this.terminal = terminal; this.systemInformation = systemInformation; this.serviceInformer = serviceInformer; this.serviceManagerFactory = serviceManagerFactory; }
public void NC_IOTerminal_Execute() { // Arrange var systemInformation = container.Resolve <NetStandard.SystemInformation.ISystemInformation>(); ProcessOutput result = null; if (systemInformation.GetOSInfo().Platform == SystemInformation.OSPlatformType.Windows) { // Act IIOTerminal iOTerminal = this.CreateIOTerminal(); result = iOTerminal.Execute(new ProcessInput { Command = "Get-WmiObject Win32_BaseBoard | Format-Wide -Property SerialNumber", ShellName = "powershell", Arguments = "-OutputFormat Text -InputFormat Text -File -" }); result.StandardOutput = result.StandardOutput.Skip(1).SkipLast(1) .Where(o => o?.Trim()?.Equals("") != true).ToArray(); // Assert } else if (systemInformation.GetOSInfo().Platform == SystemInformation.OSPlatformType.Linux) { // Act IIOTerminal iOTerminal = this.CreateIOTerminal(); result = iOTerminal.Execute(new ProcessInput { Command = "/sys/devices/virtual/dmi/id/board_serial", ShellName = "/bin/bash", Arguments = "" }); result.StandardOutput = result.StandardOutput.Skip(1).SkipLast(1) .Where(o => o?.Trim()?.Equals("") != true).ToArray(); // Assert } Console.WriteLine(string.Join(",", result.StandardOutput)); Assert.AreNotEqual(result.StandardOutput, 0); }
public SysInfo(IIOTerminal ioTerminal) { this.ioTerminal = ioTerminal; }