public void ShouldRunBatchFileBeforeRunningTargets()
        {
            UnzipSolution();

            FileSystemTestHelper.RecreateDirectory(@"BeforeBounceFeature\bounce");

            //as there is a circular dependancy between BeforeBounceFeature.sln and the main bounce dll's
            //this needs to be run and built under the same framework version
            #if (FRAMEWORKV35)
            File.WriteAllText(@"BeforeBounceFeature\bounce\beforebounce.bat", @"%SystemRoot%\Microsoft.NET\Framework\v3.5\msbuild.exe BeforeBounceFeature.sln /p:Configuration=Debug_3_5");
            #else
            File.WriteAllText(@"BeforeBounceFeature\bounce\beforebounce.bat", @"%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe BeforeBounceFeature.sln");
            #endif

            var shell = new Shell(new FakeLog());

            ProcessOutput output = null;

            FileSystemUtils.Pushd(@"BeforeBounceFeature", () => output = shell.Exec(@"..\bounce.exe", "BeforeBounceFeature"));

            Assert.That(output, Is.Not.Null);
            Assert.That(output.ExitCode, Is.EqualTo(0));
            Assert.That(output.Error.Trim(), Is.EqualTo(""));
            Assert.That(output.Output, Is.StringContaining("building before bounce feature"));
        }
예제 #2
0
        public void CanRunATask() {
            var shell = new Shell(new FakeLog());

            ProcessOutput output = null;

            FileSystemUtils.Pushd(@"..\..\..\TestBounceAssembly", () => output = shell.Exec(@"..\Bounce.Console.Tests\bin\Debug\bounce.exe", "Task1"));

            Assert.That(output, Is.Not.Null);
            Assert.That(output.ExitCode, Is.EqualTo(0));
            Assert.That(output.Error.Trim(), Is.EqualTo(""));
            Assert.That(output.Output, Is.StringContaining("task1"));
        }
예제 #3
0
		public void CanRunMultipleTasksWithMultipleArguments() {
			var shell = new Shell(new FakeLog());

			ProcessOutput output = null;

			FileSystemUtils.Pushd(@"..\..\..\TestBounceAssembly\bin\Debug", () => output = shell.Exec(@"..\..\..\Bounce.Console.Tests\bin\Debug\bounce.exe", "Task3 Task4 Task5 /a a /b:b /c c"));

			Assert.That(output, Is.Not.Null);
			Assert.That(output.ExitCode, Is.EqualTo(0));
			Assert.That(output.Error.Trim(), Is.EqualTo(""));
			Assert.That(output.Output, Is.StringContaining("a=a"));
			Assert.That(output.Output, Is.StringContaining("b=b"));
			Assert.That(output.Output, Is.StringContaining("c=c"));
		}
        public void ShouldPrintOutputOfScriptIfItFailed()
        {
            UnzipSolution();

            FileSystemTestHelper.RecreateDirectory(@"BeforeBounceFeature\BeforeBounceFeature\bounce");
            File.WriteAllText(@"BeforeBounceFeature\BeforeBounceFeature\bounce\beforebounce.bat", @"c:\Windows\Microsoft.NET\Framework\v3.5\msbuild.exe NonExtantSolution.sln");

            var shell = new Shell(new FakeLog());

            ProcessOutput output = null;

            Pushd(@"BeforeBounceFeature\BeforeBounceFeature", () => shell.Exec(@"..\..\bounce.exe", "BeforeBounceFeature"));

            Assert.That(output, Is.Not.Null);
            Assert.That(output.ExitCode, Is.EqualTo(1));
            Assert.That(output.Error, Is.StringContaining("MSBUILD : error MSB1009: Project file does not exist."));
        }