public void ShouldGetEmptyLinkedProjectList()
        {
            MockIVsSolution            solution = new MockIVsSolution();
            TestableProjectLinkTracker tracker  = new TestableProjectLinkTracker(new MockDocumentTracker(), solution);

            IEnumerable <ProjectLink> projectLinks = tracker.GetProjectLinks();

            Assert.IsNotNull(projectLinks);
            Assert.AreEqual(0, projectLinks.Count());
        }
        public void ShouldUnlinkProjects()
        {
            MockIVsSolution            solution          = new MockIVsSolution();
            TestableProjectLinkTracker tracker           = new TestableProjectLinkTracker(new MockDocumentTracker(), solution);
            MockVsHierarchy            sourceVsHierarchy = new MockVsHierarchy();
            MockVsHierarchy            targetVsHierarchy = new MockVsHierarchy();

            solution.Hierarchies.Add(sourceVsHierarchy);
            solution.Hierarchies.Add(targetVsHierarchy);
            tracker.AddProjectLink(sourceVsHierarchy, targetVsHierarchy);
            targetVsHierarchy.GetPropertyProjectValue.Globals.SetVariablePersistsCalled = false;

            tracker.UnlinkProjects(sourceVsHierarchy.GetPropertyProjectIdGuidValue, targetVsHierarchy.GetPropertyProjectIdGuidValue);

            Assert.AreEqual(0, tracker.GetProjectLinks().Count());
            Assert.IsTrue(targetVsHierarchy.GetPropertyProjectValue.Globals.SetVariablePersistsCalled);
            Assert.IsFalse(targetVsHierarchy.GetPropertyProjectValue.Globals.SetVariablePersistsArgumentValue);
        }
        public void ShouldGetLinkedProject()
        {
            MockIVsSolution            solution            = new MockIVsSolution();
            TestableProjectLinkTracker tracker             = new TestableProjectLinkTracker(new MockDocumentTracker(), solution);
            MockVsHierarchy            project1VsHierarchy = new MockVsHierarchy();
            MockVsHierarchy            project2VsHierarchy = new MockVsHierarchy();

            solution.Hierarchies.Add(project1VsHierarchy);
            solution.Hierarchies.Add(project2VsHierarchy);

            tracker.AddProjectLink(project1VsHierarchy, project2VsHierarchy);

            IEnumerable <ProjectLink> projectLinks = tracker.GetProjectLinks();

            Assert.AreEqual(1, projectLinks.Count());
            ProjectLink projectLink = projectLinks.ElementAt(0);

            Assert.AreEqual(project1VsHierarchy.GetPropertyProjectIdGuidValue, projectLink.SourceProjectId);
            Assert.AreEqual(project2VsHierarchy.GetPropertyProjectIdGuidValue, projectLink.TargetProjectId);
        }