public void TestProcessRunPassesCorrectValues() { ShimXboxProcess.RunXboxConsoleStringStringXboxOperatingSystemActionOfString = (console, fileName, arguments, operatingSystem, outputReceivedCallback) => { Type processType = typeof(XboxProcess); CheckRunExecutableValueEquality(processType, console.SystemIpAddress.ToString(), fileName, arguments, operatingSystem, outputReceivedCallback); }; ShimXboxConsoleAdapterBase.AllInstances.RunExecutableStringStringStringXboxOperatingSystemActionOfString = (adapter, toolsIP, fileName, arguments, operatingSystem, outputReceivedCallback) => { Type adapterType = typeof(XboxConsoleAdapterBase); CheckRunExecutableValueEquality(adapterType, toolsIP, fileName, arguments, operatingSystem, outputReceivedCallback); }; ShimXboxXdkBase.AllInstances.RunExecutableStringStringStringXboxOperatingSystemActionOfString = (x, toolsIP, fileName, arguments, operatingSystem, outputReceivedCallback) => { Type xdkType = typeof(XboxXdkBase); CheckRunExecutableValueEquality(xdkType, toolsIP, fileName, arguments, operatingSystem, outputReceivedCallback); }; using (this.xboxConsole = new XboxConsole(this.processRunTestIPAddress)) { XboxProcess.Run(this.xboxConsole, ProcessRunTestFileName, ProcessRunTestArguments, ProcessRunTestOperatingSystem, this.processRunTestAction); this.processRunTestAction = null; XboxProcess.Run(this.xboxConsole, ProcessRunTestFileName, ProcessRunTestArguments, ProcessRunTestOperatingSystem); } }
public void TestProcessRunCallsAdapterRunExecutable() { bool isCorrectMethodCalled; ShimXboxConsoleAdapterBase.AllInstances.RunExecutableStringStringStringXboxOperatingSystemActionOfString = (adapter, toolsIP, fileName, arguments, operatingSystem, outputReceivedCallback) => { isCorrectMethodCalled = true; }; isCorrectMethodCalled = false; XboxProcess.Run(this.xboxConsole, ProcessRunTestFileName, ProcessRunTestArguments, ProcessRunTestOperatingSystem); Assert.IsTrue(isCorrectMethodCalled, "The static XboxProcess.Run() method didn't call the adapter's RunExecutable( ... )."); isCorrectMethodCalled = false; XboxProcess.Run(this.xboxConsole, ProcessRunTestFileName, ProcessRunTestArguments, ProcessRunTestOperatingSystem, this.processRunTestAction); Assert.IsTrue(isCorrectMethodCalled, "The static XboxProcess.Run() method didn't call the adapter's RunExecutable( ... )."); }
public void TestProcessRunAfterDispose() { this.xboxConsole = new XboxConsole(this.processRunTestIPAddress); this.xboxConsole.Dispose(); XboxProcess.Run(this.xboxConsole, ProcessRunTestFileName, ProcessRunTestArguments, ProcessRunTestOperatingSystem); }
public void TestProcessRunThrowsOnIncorrectFilePath() { XboxProcess.Run(this.xboxConsole, string.Empty, ProcessRunTestArguments, ProcessRunTestOperatingSystem); }
public void TestProcessRunThrowsOnNullConsole() { XboxProcess.Run(null, ProcessRunTestFileName, ProcessRunTestArguments, ProcessRunTestOperatingSystem); }