public void GetChildren_WithOnePropertyGroup_ReturnCorrectProperty() { string projectXml = "<Project><PropertyGroup><TestProperty>TestValue</TestProperty></PropertyGroup></Project>"; IMsBuildProject project = new MsBuildXmlProjectImplementation(CreateFromString(projectXml)); IMsBuildPropertyGroup propertyGroup = project.GetChildren <IMsBuildPropertyGroup>().First(); Assert.AreEqual("TestProperty", propertyGroup[0].Name); Assert.AreEqual("TestValue", propertyGroup[0].Value); }
public void GetChildren_WithTargetAndPropertyGroup_ReturnCorrectTargetAndPropertyGroupContent() { string projectXml = "<Project><PropertyGroup><TestProperty>Value</TestProperty></PropertyGroup><Target Name=\"TestTargetA\"></Target></Project>"; IMsBuildProject project = new MsBuildXmlProjectImplementation(CreateFromString(projectXml)); IList <IMsBuildTarget> target = project.GetChildren <IMsBuildTarget>(); Assert.AreEqual("TestTargetA", target[0].Name); IMsBuildPropertyGroup propertyGroup = project.GetChildren <IMsBuildPropertyGroup>().First(); Assert.AreEqual("Value", propertyGroup.First().Value); Assert.AreEqual("TestProperty", propertyGroup.First().Name); }