public void ShouldCreateSyncherWhenLoadingLinkedSourceProjectAfterTargetProject()
        {
            var solution = new MockIVsSolution();
            TestableProjectLinkTracker tracker = new TestableProjectLinkTracker(new MockDocumentTracker(), solution);
            var sourceHierarchy = new MockVsHierarchy();
            var targetHierarchy = new MockVsHierarchy();
            targetHierarchy.GetPropertyProjectValue.Globals.Dictionary["ProjectLinkReference"] = sourceHierarchy.GetPropertyProjectIdGuidValue.ToString();

            tracker.OnAfterOpenProject(targetHierarchy, 0);

            Assert.IsFalse(tracker.ProjectsAreLinked(sourceHierarchy, targetHierarchy));

            solution.Hierarchies.Add(sourceHierarchy);
            tracker.OnAfterOpenProject(sourceHierarchy, 0);

            Assert.IsTrue(tracker.ProjectsAreLinked(sourceHierarchy, targetHierarchy));
        }
        public void ShouldNotRestartTrackingIfSourceAndTargetProjectsAreClosedAndSourceGetsReopened()
        {
            var solution = new MockIVsSolution();
            TestableProjectLinkTracker tracker = new TestableProjectLinkTracker(new MockDocumentTracker(), solution);
            var sourceHierarchy = new MockVsHierarchy();
            var targetHierarchy = new MockVsHierarchy();
            targetHierarchy.GetPropertyProjectValue.Globals.Dictionary["ProjectLinkReference"] = sourceHierarchy.GetPropertyProjectIdGuidValue.ToString();
            solution.Hierarchies.Add(sourceHierarchy);
            tracker.OnAfterOpenProject(sourceHierarchy, 0);
            tracker.OnAfterOpenProject(targetHierarchy, 0);

            tracker.OnBeforeCloseProject(sourceHierarchy, 0);
            tracker.OnBeforeCloseProject(targetHierarchy, 0);
            tracker.OnAfterOpenProject(sourceHierarchy, 0);

            Assert.IsFalse(tracker.ProjectsAreLinked(sourceHierarchy, targetHierarchy));
        }