Permalink
Browse files

Add a second failing test which more describes the problem.

  • Loading branch information...
1 parent f46cc8c commit ed91b9526d4af0febecee1607727dc5bd0156813 @lanwin lanwin committed Jul 1, 2010
Showing with 21 additions and 0 deletions.
  1. +21 −0 source/MongoDB.Tests/UnitTests/Serialization/SerializationFactoryTests.cs
@@ -292,5 +292,26 @@ public void CanWriteByteArrayPropertyFromBinary()
Assert.AreEqual(3, helper.Property[2]);
Assert.AreEqual(4, helper.Property[3]);
}
+
+ public class EmbeddedDocumentHelper
+ {
+ public Document Document { get; set; }
+ }
+
+ [Test]
+ public void CanReadEmbeddedDocument()
+ {
+ var bson = Serialize(new Document("Document", new Document("value", 10)));
+
+ var helper = Deserialize<EmbeddedDocumentHelper>(bson);
+
+ Assert.IsNotNull(helper);
+ Assert.IsNotNull(helper.Document);
+ Assert.AreEqual(1, helper.Document.Count);
+ var embedded = helper.Document["Document"] as Document;
+ Assert.IsNotNull(embedded);
+ Assert.AreEqual(1, embedded.Count);
+ Assert.AreEqual(10, embedded["value"]);
+ }
}
}

0 comments on commit ed91b95

Please sign in to comment.