public void SetUp()
        {
            _project = new Project(Path.GetFullPath("someProject.csproj"), new ProjectDocument(ProjectType.CSharp));
			_project.Value.SetOutputPath("");
			_project.Value.SetAssemblyName("someAssembly.dll");
            _bus = MockRepository.GenerateMock<IMessageBus>();
            _listGenerator = MockRepository.GenerateMock<IGenerateBuildList>();
            _configuration = MockRepository.GenerateMock<IConfiguration>();
            _buildRunner = MockRepository.GenerateMock<IBuildRunner>();
            _testRunner = MockRepository.GenerateMock<ITestRunner>();
			_testAssemblyValidator = MockRepository.GenerateMock<IDetermineIfAssemblyShouldBeTested>();
			_optimizer = MockRepository.GenerateMock<IOptimizeBuildConfiguration>();
			_runInfo = new RunInfo(_project);
			_runInfo.ShouldBuild();
			_runInfo.SetAssembly(_project.Value.AssemblyName);
			_optimizer.Stub(o => o.AssembleBuildConfiguration(new string[] {})).IgnoreArguments().Return(new RunInfo[] { _runInfo });
            _preProcessor = MockRepository.GenerateMock<IPreProcessTestruns>();
            _preProcessor.Stub(x => x.PreProcess(null)).IgnoreArguments().Return(new RunInfo[] { _runInfo });
            var preProcessors = new IPreProcessTestruns[] { _preProcessor };
            var buildPreProcessor = MockRepository.GenerateMock<IPreProcessBuildruns>();
            buildPreProcessor.Stub(x => x.PreProcess(null)).IgnoreArguments().Return(new RunInfo[] { _runInfo });
            var buildPreProcessors = new IPreProcessBuildruns[] { buildPreProcessor };
            _removedTestLocator = MockRepository.GenerateMock<ILocateRemovedTests>();
            _consumer = new ProjectChangeConsumer(_bus, _listGenerator, _configuration, _buildRunner, new ITestRunner[] { _testRunner }, _testAssemblyValidator, _optimizer, preProcessors, _removedTestLocator, buildPreProcessors);
        }
Esempio n. 2
0
        public void SetUp()
        {
            _project = new Project(Path.GetFullPath("someProject.csproj"), new ProjectDocument(ProjectType.CSharp));
            _project.Value.SetOutputPath("");
            _project.Value.SetAssemblyName("someAssembly.dll");
            _bus                   = MockRepository.GenerateMock <IMessageBus>();
            _listGenerator         = MockRepository.GenerateMock <IGenerateBuildList>();
            _configuration         = MockRepository.GenerateMock <IConfiguration>();
            _buildRunner           = MockRepository.GenerateMock <IBuildRunner>();
            _testRunner            = MockRepository.GenerateMock <ITestRunner>();
            _testAssemblyValidator = MockRepository.GenerateMock <IDetermineIfAssemblyShouldBeTested>();
            _optimizer             = MockRepository.GenerateMock <IOptimizeBuildConfiguration>();
            _fs       = MockRepository.GenerateMock <IFileSystemService>();
            _cache    = MockRepository.GenerateMock <ICache>();
            _runCache = MockRepository.GenerateMock <IRunResultCache>();
            _runInfo  = new RunInfo(_project);
            _runInfo.ShouldBuild();
            _runInfo.SetAssembly(_project.Value.AssemblyName);
            _optimizer.Stub(o => o.AssembleBuildConfiguration(new string[] {})).IgnoreArguments().Return(new RunInfo[] { _runInfo });
            _preProcessor = MockRepository.GenerateMock <IPreProcessTestruns>();
            _preProcessor.Stub(x => x.PreProcess(null)).IgnoreArguments().Return(new PreProcessedTesRuns(null, new RunInfo[] { _runInfo }));
            var preProcessors     = new IPreProcessTestruns[] { _preProcessor };
            var buildPreProcessor = MockRepository.GenerateMock <IPreProcessBuildruns>();

            buildPreProcessor.Stub(x => x.PreProcess(null)).IgnoreArguments().Return(new RunInfo[] { _runInfo });
            var buildPreProcessors = new IPreProcessBuildruns[] { buildPreProcessor };

            _removedTestLocator = MockRepository.GenerateMock <ILocateRemovedTests>();
            _buildSessionRunner = new BuildSessionRunner(new BuildConfiguration(null), _cache, _bus, _configuration, _buildRunner, buildPreProcessors, _fs, _runCache);
            _consumer           = new ProjectChangeConsumer(_bus, _listGenerator, _configuration, _buildSessionRunner, new ITestRunner[] { _testRunner }, _testAssemblyValidator, _optimizer, preProcessors, _removedTestLocator);
        }
        public void SetUp()
        {
            _bus = MockRepository.GenerateMock<IMessageBus>();
            _testRunner = MockRepository.GenerateMock<ITestRunner>();
			_testAssemblyValidator = MockRepository.GenerateMock<IDetermineIfAssemblyShouldBeTested>();
            _preProcessor = MockRepository.GenerateMock<IPreProcessTestruns>();
            var preProcessors = new IPreProcessTestruns[] { _preProcessor };
            _consumer = new AssemblyChangeConsumer(new ITestRunner[] { _testRunner }, _bus, _testAssemblyValidator, preProcessors);
			_testRunner.Stub(r => r.RunTests(null)).IgnoreArguments().Return(new TestRunResults[] {});
        }
 public AssemblyChangeConsumer(ITestRunner[] testRunners, IMessageBus bus, IDetermineIfAssemblyShouldBeTested testAssemblyValidator, IPreProcessTestruns[] preProcessors, ILocateRemovedTests removedTestLocator, ICache cache, IConfiguration config)
 {
     _testRunners           = testRunners;
     _bus                   = bus;
     _testAssemblyValidator = testAssemblyValidator;
     _preProcessors         = preProcessors;
     _removedTestLocator    = removedTestLocator;
     _cache                 = cache;
     _config                = config;
 }
 public ProjectChangeConsumer(IMessageBus bus, IGenerateBuildList listGenerator, IConfiguration configuration, IBuildSessionRunner buildRunner, ITestRunner[] testRunners, IDetermineIfAssemblyShouldBeTested testAssemblyValidator, IOptimizeBuildConfiguration buildOptimizer, IPreProcessTestruns[] preProcessors, ILocateRemovedTests removedTestLocator)
 {
     _bus                   = bus;
     _listGenerator         = listGenerator;
     _buildRunner           = buildRunner;
     _testRunners           = testRunners;
     _testAssemblyValidator = testAssemblyValidator;
     _buildOptimizer        = buildOptimizer;
     _preProcessors         = preProcessors;
     _removedTestLocator    = removedTestLocator;
 }
        public void SetUp()
        {
            _bus = MockRepository.GenerateMock<IMessageBus>();
            _testRunner = MockRepository.GenerateMock<ITestRunner>();
			_testAssemblyValidator = MockRepository.GenerateMock<IDetermineIfAssemblyShouldBeTested>();
            _preProcessor = MockRepository.GenerateMock<IPreProcessTestruns>();
            var preProcessors = new IPreProcessTestruns[] { _preProcessor };
            _removedTestLocator = MockRepository.GenerateMock<ILocateRemovedTests>();
			_cache = MockRepository.GenerateMock<ICache>();
			_config = MockRepository.GenerateMock<IConfiguration>();
			_cache.Stub(x => x.GetAll<Project>()).Return(new Project[] {});

            _consumer = new AssemblyChangeConsumer(new ITestRunner[] { _testRunner }, _bus, _testAssemblyValidator, preProcessors, _removedTestLocator, _cache, _config);
			_testRunner.Stub(r => r.RunTests(null, null, null)).IgnoreArguments().Return(new TestRunResults[] {});
        }
Esempio n. 7
0
        public void SetUp()
        {
            _bus                   = MockRepository.GenerateMock <IMessageBus>();
            _testRunner            = MockRepository.GenerateMock <ITestRunner>();
            _testAssemblyValidator = MockRepository.GenerateMock <IDetermineIfAssemblyShouldBeTested>();
            _preProcessor          = MockRepository.GenerateMock <IPreProcessTestruns>();
            var preProcessors = new IPreProcessTestruns[] { _preProcessor };

            _removedTestLocator = MockRepository.GenerateMock <ILocateRemovedTests>();
            _cache  = MockRepository.GenerateMock <ICache>();
            _config = MockRepository.GenerateMock <IConfiguration>();
            _cache.Stub(x => x.GetAll <Project>()).Return(new Project[] {});

            _consumer = new AssemblyChangeConsumer(new ITestRunner[] { _testRunner }, _bus, _testAssemblyValidator, preProcessors, _removedTestLocator, _cache, _config);
            _testRunner.Stub(r => r.RunTests(null, null, null)).IgnoreArguments().Return(new TestRunResults[] {});
        }
        public void SetUp()
        {
            _project = new Project(Path.GetFullPath("someProject.csproj"), new ProjectDocument(ProjectType.CSharp));
			_project.Value.SetOutputPath("");
			_project.Value.SetAssemblyName("someAssembly.dll");
            _bus = MockRepository.GenerateMock<IMessageBus>();
            _listGenerator = MockRepository.GenerateMock<IGenerateBuildList>();
            _configuration = MockRepository.GenerateMock<IConfiguration>();
            _buildRunner = MockRepository.GenerateMock<IBuildRunner>();
            _testRunner = MockRepository.GenerateMock<ITestRunner>();
			_testAssemblyValidator = MockRepository.GenerateMock<IDetermineIfAssemblyShouldBeTested>();
			_optimizer = MockRepository.GenerateMock<IOptimizeBuildConfiguration>();
			var runInfo = new RunInfo(_project);
			runInfo.ShouldBuild();
			_optimizer.Stub(o => o.AssembleBuildConfiguration(null)).IgnoreArguments().Return(new RunInfo[] { runInfo });
            _consumer = new ProjectChangeConsumer(_bus, _listGenerator, _configuration, _buildRunner, new ITestRunner[] { _testRunner }, _testAssemblyValidator, _optimizer);
        }