Esempio n. 1
0
        public void ObjectPrinter_Should_ContainDictionaryInfo()
        {
            var collection = new Dictionary <int, PersonWithChild>();

            for (var i = 0; i < 5; i++)
            {
                collection[i] = new PersonWithChild {
                    Name = "Test" + i, Age = i
                };
            }
            var result = collection.PrintToString();

            for (var i = 0; i < 5; i++)
            {
                result.Should().Contain(nameof(PersonWithChild.Name) + " = " + "Test" + i);
                result.Should().Contain(nameof(PersonWithChild.Age) + " = " + i);
            }
        }
Esempio n. 2
0
 public void SetUp()
 {
     person = new PersonWithChild {
         Name = "Alex", Age = 19, Height = 30
     };
 }