public void CheckForCycles_FRN49()
        {
            var context = new FudgeContext();
            var serializer = new FudgeSerializer(context);

            var testObj = new ClassWithCycles();
            testObj.Child = new ClassWithCycles();
            serializer.SerializeToMsg(testObj);        // Doesn't throw because no cycles

            testObj.Child = testObj;
            Assert.Throws<FudgeRuntimeException>(() => serializer.SerializeToMsg(testObj));
        }
Exemple #2
0
        public void CheckForCycles_FRN49()
        {
            var context    = new FudgeContext();
            var serializer = new FudgeSerializer(context);

            var testObj = new ClassWithCycles();

            testObj.Child = new ClassWithCycles();
            serializer.SerializeToMsg(testObj);        // Doesn't throw because no cycles

            testObj.Child = testObj;
            Assert.Throws <FudgeRuntimeException>(() => serializer.SerializeToMsg(testObj));
        }