NSNumber: Keep track of the original number type when parsing from XML

This commit is contained in:
Frederik Carlier
2016-05-24 22:49:37 +02:00
parent 6571783fab
commit 3c4e3257f2
6 changed files with 94 additions and 27 deletions

View File

@@ -126,6 +126,18 @@ namespace plistcil.test
NSDictionary dict = (NSDictionary)PropertyListParser.Parse(new FileInfo("test-files/issue49.plist"));
Assert.AreEqual(0, dict.Count);
}
[Test]
public static void TestRealInResourceRule()
{
NSDictionary dict = (NSDictionary)XmlPropertyListParser.Parse(new FileInfo("test-files/ResourceRules.plist"));
Assert.AreEqual(1, dict.Count);
Assert.IsTrue(dict.ContainsKey("weight"));
var weight = dict["weight"].ToObject();
Assert.IsInstanceOf<double>(weight);
Assert.AreEqual(10d, (double)weight);
}
}
}