public ProjectItemLink(ProjectItemLinkDescription description, ProjectItem projectItem)
 {
     Description = description;
     ProjectItem = projectItem;
 }
Example #2
0
        public void TestRemoveLink()
        {
            var underTest = new Project();
            var itemKind = "test";

            var item1 = new ProjectItem("p1", itemKind);
            var item2 = new ProjectItem("p2", itemKind);

            underTest.AddItem(item1);
            underTest.AddItem(item2);

            var link = new ProjectItemLinkDescription("desc");
            underTest.AddLink(item1, link, item2);

            underTest.RemoveLink(item1, link, item2);

            AssertEmptyLinkList(item1);
            AssertEmptyLinkList(item2);
        }
Example #3
0
 private static void AssertLinkedItem(ProjectItem item1, ProjectItem item2, ProjectItemLinkDescription description)
 {
     var result = item1.GetLinkedItems();
     Assert.NotNull(result);
     var resultList = result.ToList();
     Assert.Equal(1, resultList.Count);
     Assert.Equal(item2, resultList[0].ProjectItem);
     Assert.Equal(description, resultList[0].Description);
 }
Example #4
0
        public void TestAddLink()
        {
            var underTest = new Project();
            var itemKind = "test";

            var item1 = new ProjectItem("p1", itemKind);
            var item2 = new ProjectItem("p2", itemKind);

            underTest.AddItem(item1);
            underTest.AddItem(item2);

            var link = new ProjectItemLinkDescription("desc");
            underTest.AddLink(item1, link, item2);

            AssertLinkedItem(item1, item2, link);
            AssertLinkedItem(item2, item1, link);
        }