示例#1
0
        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);
            }
        }
示例#2
0
        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( ... ).");
        }
示例#3
0
 public void TestProcessRunAfterDispose()
 {
     this.xboxConsole = new XboxConsole(this.processRunTestIPAddress);
     this.xboxConsole.Dispose();
     XboxProcess.Run(this.xboxConsole, ProcessRunTestFileName, ProcessRunTestArguments, ProcessRunTestOperatingSystem);
 }
示例#4
0
 public void TestProcessRunThrowsOnIncorrectFilePath()
 {
     XboxProcess.Run(this.xboxConsole, string.Empty, ProcessRunTestArguments, ProcessRunTestOperatingSystem);
 }
示例#5
0
 public void TestProcessRunThrowsOnNullConsole()
 {
     XboxProcess.Run(null, ProcessRunTestFileName, ProcessRunTestArguments, ProcessRunTestOperatingSystem);
 }