public void ShouldDispatchOnlyToMatchingSynchers()
        {
            TestableProjectLinkTracker tracker  = new TestableProjectLinkTracker(new MockDocumentTracker(), new MockIVsSolution());
            MockVsHierarchy            project1 = new MockVsHierarchy();
            MockVsHierarchy            project2 = new MockVsHierarchy();
            MockVsHierarchy            project3 = new MockVsHierarchy();

            MockProjectItemsSyncer syncherMatching    = new MockProjectItemsSyncer(project1.GetPropertyProjectValue, project2.GetPropertyProjectValue);
            MockProjectItemsSyncer syncherNonMatching =
                new MockProjectItemsSyncer(project3.GetPropertyProjectValue, project2.GetPropertyProjectValue);

            tracker.AddProjectSyncer(syncherMatching);
            tracker.AddProjectSyncer(syncherNonMatching);

            tracker.OnAfterAddFilesEx(1, 1, new[] { project1 }, new[] { 0 }, new[] { "File1.txt" },
                                      new[] { VSADDFILEFLAGS.VSADDFILEFLAGS_NoFlags });

            Assert.IsTrue(syncherMatching.FilesAddedToSourceCalled);
            Assert.IsFalse(syncherNonMatching.FilesAddedToSourceCalled);
        }
        public void ShouldDispatchRemoveDirectoriesToSyncher()
        {
            TestableProjectLinkTracker tracker  = new TestableProjectLinkTracker(new MockDocumentTracker(), new MockIVsSolution());
            MockVsHierarchy            project1 = new MockVsHierarchy();
            MockVsHierarchy            project2 = new MockVsHierarchy();

            MockProjectItemsSyncer syncher = new MockProjectItemsSyncer(project1.GetPropertyProjectValue, project2.GetPropertyProjectValue);

            tracker.AddProjectSyncer(syncher);

            tracker.OnAfterRemoveDirectories(1, 1, new[] { project1 }, new[] { 0 }, new[] { "Myfolder" },
                                             new[] { VSREMOVEDIRECTORYFLAGS.VSREMOVEDIRECTORYFLAGS_NoFlags });

            Assert.IsTrue(syncher.DirectoriesRemovedFromSourceCalled);
        }
        public void ShouldDispatchRenameFilesToSyncher()
        {
            TestableProjectLinkTracker tracker  = new TestableProjectLinkTracker(new MockDocumentTracker(), new MockIVsSolution());
            MockVsHierarchy            project1 = new MockVsHierarchy();
            MockVsHierarchy            project2 = new MockVsHierarchy();

            MockProjectItemsSyncer syncher = new MockProjectItemsSyncer(project1.GetPropertyProjectValue, project2.GetPropertyProjectValue);

            tracker.AddProjectSyncer(syncher);

            tracker.OnAfterRenameFiles(1, 2, new[] { project1 }, new[] { 0 }, new[] { "oldFileName", "oldDirectoryName" },
                                       new[] { "newFileName", "newDirectoryName" },
                                       new[] { VSRENAMEFILEFLAGS.VSRENAMEFILEFLAGS_NoFlags, VSRENAMEFILEFLAGS.VSRENAMEFILEFLAGS_Directory });

            Assert.IsTrue(syncher.FilesRenamedInSourceCalled);
        }