コード例 #1
0
        public void TestRemoveItemAt3()
        {
            BuildItemGroup big = new BuildItemGroup();

            big.AddNewItem("a", "b");
            big.AddNewItem("b", "c");
            big.AddNewItem("c", "d");

            big.RemoveItemAt(3);
        }
コード例 #2
0
        public void RemoveItemAtSimple()
        {
            project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems);
            BuildItemGroup group = GetBuildItemGroupFromProject(project, false);

            group.RemoveItemAt(1);

            Assertion.AssertEquals(2, group.Count);
            Dictionary <string, string> items = GetDictionaryOfBuildItemsInProject(project, false);

            Assertion.AssertEquals("i1", items["n1"]);
            Assertion.AssertEquals("i3", items["n3"]);
        }
コード例 #3
0
        public void RemoveItemAt1()
        {
            XmlElement     ig    = CreatePersistedItemGroupElement();
            BuildItemGroup group = new BuildItemGroup(ig, false, new Project());

            BuildItem i2 = group[1];

            group.RemoveItemAt(1);

            Assertion.AssertEquals(1, group.Count);
            Assertion.AssertEquals(1, group.ItemGroupElement.ChildNodes.Count);
            Assertion.AssertEquals("i1", group[0].Include);
            Assertion.AssertEquals(null, i2.ParentPersistedItemGroup);
        }
コード例 #4
0
        public void TestRemoveItemAt1()
        {
            BuildItemGroup big = new BuildItemGroup();

            big.AddNewItem("a", "b");
            big.AddNewItem("b", "c");
            big.AddNewItem("c", "d");

            big.RemoveItemAt(1);

            BuildItem[] items = big.ToArray();
            Assert.AreEqual(2, big.Count, "A1");
            Assert.AreEqual("a", items [0].Name, "A2");
            Assert.AreEqual("c", items [1].Name, "A3");
        }
コード例 #5
0
        public void ToArrayChangeMadeToGroup()
        {
            project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems);
            BuildItemGroup group = GetBuildItemGroupFromProject(project, false);

            BuildItem[] items = group.ToArray();
            Assertion.AssertEquals(3, items.Length);

            //// Change first item in group by removing it and re-adding it with a new itemInclude value
            group.RemoveItemAt(0);
            group.AddNewItem("n1", "New");

            Dictionary <string, string> groupItems = GetDictionaryOfBuildItemsInBuildItemsGroup(group);

            Assertion.AssertEquals("i1", items[0].Include);
            Assertion.AssertEquals("New", groupItems["n1"]);
        }
コード例 #6
0
        public void RemoveItemAtFirstItem()
        {
            BuildItemGroup group = new BuildItemGroup();

            group.AddNewItem("n1", "i1");
            group.AddNewItem("n2", "i2");
            group.AddNewItem("n3", "i3");

            group.RemoveItemAt(0);

            Assertion.AssertEquals(2, group.Count);

            Dictionary <string, string> items = GetDictionaryOfBuildItemsInBuildItemsGroup(group);

            Assertion.AssertEquals("i2", items["n2"]);
            Assertion.AssertEquals("i3", items["n3"]);
        }