Beispiel #1
0
        public void PrintToString_WhenNestedClass()
        {
            var parent = new Person {
                Name = "Parent"
            };
            var children = new PersonWithParent {
                Name = "Children", Parent = parent
            };

            children.PrintToString().Should().Contain(parent.Name).And.Contain(children.Name);
        }
Beispiel #2
0
        public void PrintToString_WhenCircleRefClass()
        {
            var parent = new PersonWithParent {
                Name = "Parent"
            };
            var children = new PersonWithParent {
                Name = "Children", Parent = parent
            };

            parent.Parent = children;
            children.PrintToString().Should().Contain("circle reference");
        }