Exemplo n.º 1
0
		public void HandleProjects(FileChangeMessage message)
		{
			foreach (var file in message.Files)
			{
				handleProject(".csproj", file);
				handleProject(".vbproj", file);
			}
		}
Exemplo n.º 2
0
 private void displayFileChangeMessage(FileChangeMessage fileChangeMessage)
 {
     lock (_outputLock)
     {
         foreach (var file in fileChangeMessage.Files)
             writeToOutput("Found file change: " + file.FullName);
         writeToOutput("");
     }
 }
        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_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();
		}