AutoMapper.UnitTests.MaxDepthTests.Second_level_children_are_not_null_with_max_depth_2 C# (CSharp) Method

Second_level_children_are_not_null_with_max_depth_2() private method

        public void Second_level_children_are_not_null_with_max_depth_2()
        {
            var config = new MapperConfiguration(cfg => cfg.CreateMap<Source, Destination>().MaxDepth(2));
            var destination = config.CreateMapper().Map<Source, Destination>(_source);
            foreach (var child in destination.Children)
            {
                2.ShouldEqual(child.Level);
                child.ShouldNotBeNull();
                destination.ShouldEqual(child.Parent);
            }
        }