}
+ // A shallow clone of this object cannot be created.
[Test]
- [ExpectedException (typeof (InvalidOperationException),
- "A shallow clone of this object cannot be created.")]
+ [ExpectedException (typeof (InvalidOperationException))]
public void TestClone1 ()
{
bp = new BuildProperty ("name", "value");
Assert.AreEqual ("true", a.Condition, "A1");
}
+ // Cannot set a condition on an object not represented by an XML element in the project file.
[Test]
- [ExpectedException (typeof (InvalidOperationException),
- "Cannot set a condition on an object not represented by an XML element in the project file.")]
+ [ExpectedException (typeof (InvalidOperationException))]
public void TestCondition2 ()
{
BuildProperty a = new BuildProperty ("name", "value");
node = xd.SelectSingleNode ("tns:Project/tns:PropertyGroup/tns:Name", TestNamespaceManager.NamespaceManager);
Assert.AreEqual ("AnotherValue", node.InnerText, "A1");
}
+
+ [Test]
+ [Category ("NotDotNet")]
+ public void TestValueXml ()
+ {
+ BuildPropertyGroup [] bpgs = new BuildPropertyGroup [1];
+ BuildProperty [] props;
+ XmlDocument xd;
+ XmlNode node;
+
+ string documentString = @"
+ <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+ <PropertyGroup>
+ <Name>Value</Name>
+ </PropertyGroup>
+ </Project>
+ ";
+
+ engine = new Engine (Consts.BinPath);
+
+ project = engine.CreateNewProject ();
+ project.LoadXml (documentString);
+
+ project.PropertyGroups.CopyTo (bpgs, 0);
+ bpgs[0].AddNewProperty("XmlProp", "<XmlStuff></XmlStuff>");
+
+ xd = new XmlDocument ();
+ xd.LoadXml (project.Xml);
+ node = xd.SelectSingleNode ("tns:Project/tns:PropertyGroup/tns:XmlProp/tns:XmlStuff", TestNamespaceManager.NamespaceManager);
+ if (node == null) {
+ Console.WriteLine (project.Xml);
+ Assert.Fail ("Expected node to be non-null");
+ }
+ }
+
}
}