Imported Upstream version 5.12.0.220

Former-commit-id: c477e03582759447177c6d4bf412cd2355aad476
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-04-24 09:31:23 +00:00
parent 8bd104cef2
commit 8fc30896db
1200 changed files with 29534 additions and 26161 deletions

View File

@ -81,6 +81,28 @@ namespace MonoTests.System.Configuration {
Assert.AreEqual ("<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<int>7</int>", ((string)v.SerializedValue).Replace ("\r\n", "\n"), "A13");
}
[Test]
public void Properties_ChangeSerialzeAs ()
{
SettingsProperty p = new SettingsProperty ("property",
typeof (int),
null,
true,
10,
SettingsSerializeAs.String,
null,
true,
false);
SettingsPropertyValue v = new SettingsPropertyValue (p);
// test that setting SerializeAs after changing v.PropertyValue causes
// SerializedValue to be in the new format
v.PropertyValue = (object)5;
p.SerializeAs = SettingsSerializeAs.Xml;
Assert.AreEqual ("<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<int>5</int>", ((string)v.SerializedValue).Replace("\r\n", "\n"), "A99");
}
[Test]
public void Dirty ()
{
@ -221,6 +243,29 @@ namespace MonoTests.System.Configuration {
}
/// <summary>
/// This tests the case where we have a SerializedValue but not a PropertyValue.
/// </summary>
[Test]
public void Xml_SerializeNoPropValue ()
{
SettingsProperty p = new SettingsProperty ("property",
typeof (MyData),
null,
true,
10,
SettingsSerializeAs.Xml,
null,
true,
false);
SettingsPropertyValue v = new SettingsPropertyValue (p);
v.SerializedValue = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<int>10</int>";
Assert.AreEqual ("<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<int>10</int>", v.SerializedValue);
}
[Test]
public void Binary_Serialize ()
{