public void Should_add_projects_that_doesnt_exist()
        {
            var project = new Project("", new ProjectDocument(ProjectType.VisualBasic));
            var cache = MockRepository.GenerateMock<ICache>();
            var message = new FileChangeMessage();
            message.AddFile(new ChangedFile(string.Format("TestResources{0}VS2008{0}NUnitTestProjectVisualBasic.vbproj", Path.DirectorySeparatorChar)));
            cache.Stub(c => c.Get<Project>(message.Files[0].FullName)).Return(null).Repeat.Once();
            cache.Stub(c => c.Get<Project>(message.Files[0].FullName)).Return(project).Repeat.Once();

            var marker = new ProjectRebuildMarker(cache);
            marker.HandleProjects(message);

            cache.AssertWasCalled(c => c.Add<Project>(message.Files[0].FullName));
        }
        public void Should_never_handle_realtime_tests()
        {
            var project = new Project("", new ProjectDocument(ProjectType.VisualBasic));
            var cache = MockRepository.GenerateMock<ICache>();
            var config = MockRepository.GenerateMock<IConfiguration>();
            var file = new ChangedFile(string.Format("TestResources{0}VS2008{0}_rltm_build_fl_Bleh.csproj", Path.DirectorySeparatorChar));
            cache.Stub(c => c.Get<Project>(file.FullName)).Return(null).Repeat.Once();
            cache.Stub(c => c.Get<Project>(file.FullName)).Return(project).Repeat.Once();

            var marker = new ProjectRebuildMarker(cache, config);
            marker.HandleProjects(file);

            cache.AssertWasNotCalled(c => c.Add<Project>(file.FullName));
        }
		public void Should_mark_changed_vbproj_files_for_rebuild()
		{
            Assert.Ignore();
			var project = new Project("", new ProjectDocument(ProjectType.VisualBasic));
			var cache = MockRepository.GenerateMock<ICache>();
			cache.Stub(c => c.Get<Project>("")).IgnoreArguments().Return(project);
			
			var message = new FileChangeMessage();
			
			message.AddFile(new ChangedFile(string.Format("TestResources{0}VS2008{0}NUnitTestProjectVisualBasic.vbproj", Path.DirectorySeparatorChar)));
			var marker = new ProjectRebuildMarker(cache);
			marker.HandleProjects(message);
			
			project.Value.RequiresRebuild.ShouldBeTrue();
		}
		public void Should_mark_changed_csproj_files_for_rebuild()
		{
			var project = new Project("", new ProjectDocument(ProjectType.CSharp));
			var cache = MockRepository.GenerateMock<ICache>();
			var reloader = MockRepository.GenerateMock<IReload<Project>>();
			cache.Stub(c => c.Get<Project>("")).IgnoreArguments().Return(project);
			
			var message = new FileChangeMessage();
			
			message.AddFile(new ChangedFile(string.Format("TestResources{0}CSharpClassLibrary{0}CSharpClassLibrary.csproj", Path.DirectorySeparatorChar)));
			var marker = new ProjectRebuildMarker(cache, reloader);
			marker.HandleProjects(message);
			
			project.Value.RequiresRebuild.ShouldBeTrue();
		}