Пример #1
0
		public void TestClone2 ()
		{
			BuildItemGroup big = new BuildItemGroup ();
			big.AddNewItem ("a", "a");
			big.AddNewItem ("b", "a");

			BuildItemGroup big2 = big.Clone (true);
			BuildItem[] items = big2.ToArray ();

			Assert.AreEqual (2, big2.Count, "A1");

			Assert.AreEqual (String.Empty, items [0].Condition, "A2");
			Assert.AreEqual (String.Empty, items [0].Exclude, "A3");
			Assert.AreEqual ("a", items [0].FinalItemSpec, "A4");
			Assert.AreEqual ("a", items [0].Include, "A5");
			Assert.IsFalse (items [0].IsImported, "A6");
			Assert.AreEqual ("a", items [0].Name, "A7");
			
			Assert.AreEqual (String.Empty, items [1].Condition, "A8");
			Assert.AreEqual (String.Empty, items [1].Exclude, "A9");
			Assert.AreEqual ("a", items [1].FinalItemSpec, "A10");
			Assert.AreEqual ("a", items [1].Include, "A11");
			Assert.IsFalse (items [1].IsImported, "A12");
			Assert.AreEqual ("b", items [1].Name, "A13");
		}
Пример #2
0
        public void DeepCloneOfPersistedItemGroup()
        {
            XmlElement ig = CreatePersistedItemGroupElement();
            BuildItemGroup group = new BuildItemGroup(ig, false, new Project());

            BuildItemGroup clone = group.Clone(true);

            Assertion.AssertEquals(2, clone.Count);
            Assert.AreNotEqual(group.ItemGroupElement, clone.ItemGroupElement);
            Assert.AreNotEqual(group.ParentProject, clone.ParentProject);
        }
Пример #3
0
        public void ShallowCloneOfVirtualItemGroup()
        {
            BuildItemGroup group = new BuildItemGroup();
            group.AddNewItem("i", "i1");
            BuildItem i2 = new BuildItem("i", "i2");
            group.AddItem(i2);

            BuildItemGroup group2 = group.Clone(false /*shallow*/);

            Assertion.AssertEquals(2, group2.Count);
            Assertion.AssertEquals("i1", group2[0].FinalItemSpec);
            Assertion.Assert(i2.Equals(group2[1]));
        }
Пример #4
0
        public void ShallowCloneOfPersistedItemGroup()
        {
            XmlElement ig = CreatePersistedItemGroupElement();
            BuildItemGroup group = new BuildItemGroup(ig, false, new Project());

            BuildItemGroup clone = group.Clone(false);
        }