You've already forked linux-packaging-mono
Imported Upstream version 5.12.0.220
Former-commit-id: c477e03582759447177c6d4bf412cd2355aad476
This commit is contained in:
parent
8bd104cef2
commit
8fc30896db
@ -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 ()
|
||||
{
|
||||
|
Reference in New Issue
Block a user