Skip to content

Commit

Permalink
Add failing byte[] property deserialization test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanwin committed Jun 29, 2010
1 parent 53a453a commit 14df5eb
Showing 1 changed file with 20 additions and 0 deletions.
Expand Up @@ -272,5 +272,25 @@ public void CanSerializerAndDesializeEnumLists()
Assert.IsNotNull(deserialize.Tests);
Assert.Contains(EnumHelper.Test.A, deserialize.Tests);
}

public class ByteArrayHelper
{
public byte[] Property { get; set; }
}

[Test]
public void CanWriteByteArrayPropertyFromBinary()
{
var bson = Serialize(new Document("Property", new Binary(new byte[] {1, 2, 3, 4})));

var helper = Deserialize<ByteArrayHelper>(bson);

Assert.IsNotNull(helper);
Assert.AreEqual(4, helper.Property.Length);
Assert.AreEqual(1, helper.Property[0]);
Assert.AreEqual(2, helper.Property[1]);
Assert.AreEqual(3, helper.Property[2]);
Assert.AreEqual(4, helper.Property[3]);
}
}
}

0 comments on commit 14df5eb

Please sign in to comment.