public void ShouldThrowExceptionIfTestsFailed()
		{
			executorMock.ExpectAndReturn("Execute", ProcessResultFixture.CreateNonZeroExitCodeResult(), new object[] { new IsAnything() });

			task = new NUnitTask((ProcessExecutor) executorMock.MockInstance);
            Assert.That(delegate { task.Run(result); },
                        Throws.TypeOf<CruiseControlException>());
		}
		protected void Init()
		{
		    tempOutputFile = new TempDirectory().CreateTextFile("results.xml", "foo");
		    executorMock = new DynamicMock(typeof (ProcessExecutor));

			task = new NUnitTask(executorMock.MockInstance as ProcessExecutor);
			task.Assemblies = TEST_ASSEMBLIES;
			task.NUnitPath = NUnitConsolePath;
	        task.OutputFile = tempOutputFile.ToString();
			result = Integration("testProject", WORKING_DIRECTORY, ARTIFACT_DIRECTORY);
		}
		public void LoadWithMultipleAssemblies()
		{
			const string xml = @"<nunit>
							 <path>d:\temp\nunit-console.exe</path>
				             <assemblies>
			                     <assembly>foo.dll</assembly>
								 <assembly>bar.dll</assembly>
							</assemblies>
						 </nunit>";

			task = (NUnitTask) NetReflector.Read(xml);
			AssertEqualArrays(new string[] {"foo.dll", "bar.dll"}, task.Assemblies);
		}
		public void HandleNUnitTaskFailure()
		{
			CreateProcessExecutorMock(NUnitTask.DefaultPath);
			ExpectToExecuteAndReturn(SuccessfulProcessResult());
			IIntegrationResult result = IntegrationResult();
			result.ArtifactDirectory = Path.GetTempPath();

			task = new NUnitTask((ProcessExecutor) mockProcessExecutor.MockInstance);
			task.Assemblies = new string[] {"foo.dll"};
			task.Run(result);

			Assert.AreEqual(1, result.TaskResults.Count);
		    Assert.That(result.TaskOutput, Is.Empty);
			Verify();
		}
		public void LoadWithSingleAssemblyNunitPath()
		{
			const string xml = @"<nunit>
	<path>d:\temp\nunit-console.exe</path>
	<assemblies>
		<assembly>foo.dll</assembly>
	</assemblies>
	<outputfile>c:\testfile.xml</outputfile>
	<timeout>50</timeout>
</nunit>";
			task = (NUnitTask) NetReflector.Read(xml);
			Assert.AreEqual(@"d:\temp\nunit-console.exe", task.NUnitPath);
			Assert.AreEqual(1, task.Assemblies.Length);
			Assert.AreEqual("foo.dll", task.Assemblies[0]);
			Assert.AreEqual(@"c:\testfile.xml", task.OutputFile);
			Assert.AreEqual(50, task.Timeout);
		}
        public void LoadWithExcludedCategories()
        {
            const string xml = @"<nunit>
							 <path>d:\temp\nunit-console.exe</path>
				             <assemblies>
			                     <assembly>foo.dll</assembly>
								 <assembly>bar.dll</assembly>
							</assemblies>
                            <excludedCategories>
				                <excludedCategory>Category1</excludedCategory>
				                <excludedCategory>Category 2</excludedCategory>				
				                <excludedCategory> </excludedCategory>				
			                </excludedCategories>
						 </nunit>";

            task = (NUnitTask) NetReflector.Read(xml);
            Assert.AreEqual(3, task.ExcludedCategories.Length);
        }
Beispiel #7
0
 public CoverageTask(NUnitTask nunit, DevenvTask task, ICoverage instrument)
 {
     _nunit      = nunit;
     _builder    = task;
     _instrument = instrument;
 }
Beispiel #8
0
 public CoverageTask(NUnitTask nunit, DevenvTask task, ICoverage instrument)
 {
     _nunit = nunit;
     _builder = task;
     _instrument = instrument;
 }