public void Should_not_run_tests_for_assemblies_that_runner_doesnt_support() { _testAssemblyValidator.Stub(t => t.ShouldNotTestAssembly("")).IgnoreArguments().Return(false); _testRunner.Stub(t => t.CanHandleTestFor("")).IgnoreArguments().Return(false); var message = new AssemblyChangeMessage(); message.AddFile(new ChangedFile()); _testAssemblyValidator.Stub(t => t.ShouldNotTestAssembly(null)).IgnoreArguments().Return(true); _consumer.Consume(message); _testRunner.AssertWasNotCalled(t => t.RunTests(null, null, null), t => t.IgnoreArguments()); }
public void Should_invalidate_test_assemblys() { _project.Value.SetOutputPath(""); _project.Value.SetAssemblyName("someProject.dll"); var info = new TestRunInfo(_project, "someProject.dll"); _listGenerator.Stub(l => l.Generate(null)).IgnoreArguments().Return(new string[] { "some file.csproj" }); _configuration.Stub(c => c.BuildExecutable(_project.Value)).Return("invalid_to_not_run_builds.exe"); _testRunner.Stub(t => t.CanHandleTestFor(info.Assembly)).Return(true); _testRunner.Stub(t => t.RunTests(new TestRunInfo[] { info }, null, null)).IgnoreArguments() .Return(new TestRunResults[] { new TestRunResults("", "", false, TestRunner.NUnit, new TestResult[] { }) }); _testAssemblyValidator.Stub(t => t.ShouldNotTestAssembly("")).IgnoreArguments().Return(true); var message = new ProjectChangeMessage(); message.AddFile(new ChangedFile("some file.csproj")); _consumer.Consume(message); _testRunner.AssertWasNotCalled(t => t.RunTests(new TestRunInfo[] { new TestRunInfo(null, "") }, null, null), t => t.IgnoreArguments()); }