예제 #1
0
        public void CanRoundtripGenericLazyDictionary()
        {
            var dict = new LazyDictionary<string, object>()
                {
                    {"BlahKey", "Blah"},
                    {"FoodKey", "Foo"}
                };
            var json = SerializationService.ToJson(dict);
            var rehydrated = SerializationService.FromJson<LazyDictionary<string, object>>(json);

            Assert.That(dict.Count, Is.EqualTo(rehydrated.Count));
            Assert.That(dict.First().Key, Is.EqualTo(rehydrated.First().Key));
            Assert.That(dict.First().Value, Is.EqualTo(rehydrated.First().Value));
        }