public void ShouldContainCorrectNumberOfNestedObjects()
        {
            const int numberOfBars  = 2;
            const int numberOfBazes = 4;

            var json = new JsonConverterFooSerializer(new JsonConvertersFactory()).Serialize(TestFoo.GetDefaultFoo(), Projection.None);
            FooDeserializer <Foo> fd = new FooDeserializer <Foo>();

            var result = fd.Deserialize(json);

            Assert.AreEqual(numberOfBars, result.Bars.Count(), nameof(numberOfBars));
            Assert.AreEqual(numberOfBazes, result.Bars.Sum(c => c.Bazes.Count()), nameof(numberOfBazes));
        }
예제 #2
0
 public void Setup()
 {
     _subject = new JsonConverterFooSerializer(_jsonConverterFactory);
 }