Example #1
0
 public OperativeSystem(IIOTerminal terminal,
                        ISystemInformation systemInformation
                        )
 {
     this.terminal          = terminal;
     this.systemInformation = systemInformation;
 }
Example #2
0
 public ServiceInformer(
     ISystemInformation systemInformation,
     IIOTerminal terminal
     )
 {
     this.systemInformation = systemInformation;
     this.terminal          = terminal;
 }
Example #3
0
 public ServiceManagerForWindows(
     IIOTerminal terminal,
     ISystemInformation systemInformation,
     IServiceInformer serviceInformer
     )
 {
     this.terminal          = terminal;
     this.systemInformation = systemInformation;
     this.serviceInformer   = serviceInformer;
 }
Example #4
0
 public ServiceManager(
     IIOTerminal terminal,
     ISystemInformation systemInformation,
     IServiceInformer serviceInformer,
     IServiceManagerFactory serviceManagerFactory
     )
 {
     this.terminal              = terminal;
     this.systemInformation     = systemInformation;
     this.serviceInformer       = serviceInformer;
     this.serviceManagerFactory = serviceManagerFactory;
 }
Example #5
0
        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);
        }
Example #6
0
 public SysInfo(IIOTerminal ioTerminal)
 {
     this.ioTerminal = ioTerminal;
 }