コード例 #1
0
        public void IShellBuilderTest()
        {
            string name    = "My Shell Command";
            string workDir = "/myworkdir";
            string exec1   = "echo hello";
            string exec2   = "echo world";

            IShellCommandBuilder b = new ShellCommandBuilderImpl(_stepsBuilder, _pipelineBuilder);

            b.SetName(name)
            .InDirectory(workDir)
            .Execute(exec1)
            .Execute(exec2)
            .Build();
            ShellCommand actual = (ShellCommand)b.Collect();


            ShellCommand expected = new ShellCommand(name, exec1, exec2);

            expected.WorkDirectory = workDir;


            Assert.AreEqual(expected.WorkDirectory, actual.WorkDirectory);
            Assert.AreEqual(expected.Name, actual.Name);
            Assert.AreEqual(expected.getCommandLines(), actual.getCommandLines());
        }