Example #1
0
        public void NoThrow_WhenDeepRecursion()
        {
            var circularReference       = new CircularReference();
            var secondCircularReference = new CircularReference();

            circularReference.Self       = secondCircularReference;
            secondCircularReference.Self = circularReference;

            Assert.DoesNotThrow(() => circularReference.PrintToString());
        }
Example #2
0
        public void CircularReference_ShouldPass()
        {
            var circularReference = new CircularReference();

            var serialized = circularReference.PrintToString();

            serialized.Should()
            .Be(
                $"{nameof(CircularReference)}{Environment.NewLine}\t{nameof(circularReference.Self)} = {nameof(CircularReference)}");
        }