Example #1
0
        public async Task TestExecuteCommandLine()
        {
            TestUtils.InitializeInstallations();
            var testRunner = new ConfigRunner(TestUtils.GetTestConfig(), new SkylineBatchLogger(TestUtils.GetTestFilePath("testLog.log")));

            Assert.IsTrue(testRunner.IsStopped());
            var singleCommand = new List <string>
            {
                "echo command success  > " + TestUtils.GetTestFilePath("cmdTest.txt")
            };
            await testRunner.ExecuteCommandLine(singleCommand);

            Assert.IsTrue(File.Exists(TestUtils.GetTestFilePath("cmdTest.txt")));
            Assert.IsTrue(testRunner.IsCompleted());
            var multipleCommands = new List <string>
            {
                "cd " + TestUtils.GetTestFilePath(""), "del cmdTest.txt"
            };
            await testRunner.ExecuteCommandLine(multipleCommands);

            Assert.IsFalse(File.Exists(TestUtils.GetTestFilePath("cmdTest.txt")));
            Assert.IsTrue(testRunner.IsCompleted());
        }