Example #1
0
        public void Should_run_pre_processors()
        {
            _testAssemblyValidator.Stub(t => t.ShouldNotTestAssembly("")).Return(false);
            _testRunner.Stub(t => t.CanHandleTestFor("")).IgnoreArguments().Return(true);
            var message = new AssemblyChangeMessage();

            message.AddFile(new ChangedFile());
            _testAssemblyValidator.Stub(t => t.ShouldNotTestAssembly(null)).IgnoreArguments().Return(true);
            _consumer.Consume(message);
            _preProcessor.AssertWasCalled(p => p.PreProcess(null), p => p.IgnoreArguments());
        }
Example #2
0
        public void Should_pre_process_run_information()
        {
            _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);
            _preProcessor.AssertWasCalled(p => p.PreProcess(null), p => p.IgnoreArguments());
        }