Beispiel #1
0
        public void AddExistingItemAt()
        {
            MockLogger logger = new MockLogger();
            Project p = ObjectModelHelpers.CreateInMemoryProject(@"
                <Project xmlns=`msbuildnamespace`>
                  <ItemDefinitionGroup>
                    <i>
                      <m>m1</m>
                    </i>
                  </ItemDefinitionGroup> 
                </Project>
            ", logger);

            BuildItemGroup group = p.AddNewItemGroup();
            BuildItem item = new BuildItem("i", "i1");
            group.AddExistingItemAt(0, item);
            Expander expander = new Expander(new BuildPropertyGroup());
            item.EvaluateAllItemMetadata(expander, ParserOptions.AllowPropertiesAndItemLists, null, null);

            Assertion.AssertEquals("m1", item.GetMetadata("m"));
        }