diff --git a/tests/ServiceStack.Text.Tests/AutoMappingObjectDictionaryTests.cs b/tests/ServiceStack.Text.Tests/AutoMappingObjectDictionaryTests.cs index c90e3b2e3..b1032844f 100644 --- a/tests/ServiceStack.Text.Tests/AutoMappingObjectDictionaryTests.cs +++ b/tests/ServiceStack.Text.Tests/AutoMappingObjectDictionaryTests.cs @@ -130,6 +130,39 @@ public void Can_convert_from_ObjectDictionary_into_AutoQuery_DTO() Assert.That(request.Meta, Is.EquivalentTo(new Dictionary {{"foo", "bar"}})); } + public class PersonWithIdentities + { + public string Name { get; set; } + public List OtherNames { get;set; } + } + + public class OtherName + { + public string Name { get; set; } + } + + [Test] + public void Can_Convert_from_ObjectDictionary_Containing_Another_Object_Dictionary() + { + var map = new Dictionary + { + { "name", "Foo" }, + { "otherNames", new List + { + new Dictionary { { "name", "Fu" } }, + new Dictionary { { "name", "Fuey" } } + } + } + }; + + var fromDict = map.FromObjectDictionary(); + + Assert.AreEqual("Foo", fromDict.Name); + Assert.AreEqual(2, fromDict.OtherNames.Count); + Assert.AreEqual("Fu", fromDict.OtherNames.First().Name); + Assert.AreEqual("Fuey", fromDict.OtherNames.Last().Name); + } + public class Employee { public string FirstName { get; set; }