-Fix ReadAsBytes for empty strings

-Fix (hopefully) signing merged assemblies
This commit is contained in:
JamesNK
2010-04-20 07:51:33 +00:00
parent 2f11d3f970
commit 7085a4915f
5 changed files with 60 additions and 5 deletions
@@ -3436,5 +3436,32 @@ keyword such as type of business.""
Assert.IsTrue(d.Contains("III"));
}
#endif
private class MyClass
{
public byte[] Prop1 { get; set; }
public MyClass()
{
Prop1 = new byte[0];
}
}
[Test]
public void DeserializeByteArray()
{
JsonSerializer serializer1 = new JsonSerializer();
serializer1.Converters.Add(new IsoDateTimeConverter());
serializer1.NullValueHandling = NullValueHandling.Ignore;
string json = @"[{""Prop1"":""""},{""Prop1"":""""}]";
JsonTextReader reader = new JsonTextReader(new StringReader(json));
MyClass[] z = (MyClass[])serializer1.Deserialize(reader, typeof(MyClass[]));
Assert.AreEqual(2, z.Length);
Assert.AreEqual(0, z[0].Prop1.Length);
Assert.AreEqual(0, z[1].Prop1.Length);
}
}
}