Example #1
0
        public void ShouldSerializeDelegateWithTargetFromDifferentModule()
        {
            var withEvent = new ClassWithEvent();
            var companion = new CompanionSecondModule();

            withEvent.Event += companion.MethodAsExtension;
            var pair = Tuple.Create(withEvent, companion);

            var copy = SerializerClone(pair);

            copy.Item1.Invoke();
            Assert.AreEqual(1, copy.Item2.Counter);
        }
Example #2
0
 public static void MethodAsExtension(this CompanionSecondModule companion)
 {
     companion.Counter++;
 }