Beispiel #1
0
        public void SendSNEventHasReturn5()
        {
            ResetEveryTest();
            ISNEvent testInsintace = new SNEvent();
            int      value         = 0;

            SNFramework.Func <int, int, int, int, int, int> voidFc = (int i, int i2, int i3, int i4, int i5) => {
                return(value += i + i2 + i3 + i4 + i5);
            };


            Func <int, int, int, int, int> voidFc4 = (int i, int i2, int i3, int i4) => {
                return(value += (i + i2 + i3 + i4));
            };

            testInsintace.Register(SNMsg.ExampleMsg, voidFc4);
            testInsintace.Register(SNMsg.ExampleMsg, voidFc);
            testInsintace.DispatchHasReturn <int, int, int, int, int, int> (SNMsg.ExampleMsg, 1, 1, 1, 1, 1, ref item);
            testInsintace.DispatchHasReturn <int, int, int, int, int> (SNMsg.ExampleMsg, 1, 1, 1, 1, ref item);
            Assert.AreEqual(value, 9);
        }
Beispiel #2
0
        public void SendSNEventHasReturn3()
        {
            ResetEveryTest();
            ISNEvent testInsintace = new SNEvent();

            Func <int, int, int, int> voidFc = (int i, int i2, int i3) => {
                return(i + i2 + i3);
            };

            testInsintace.Register(SNMsg.ExampleMsg, voidFc);
            testInsintace.DispatchHasReturn <int, int, int, int> (SNMsg.ExampleMsg, 1, 1, 1, ref item);
            Assert.AreEqual(item, 3);
        }
Beispiel #3
0
        public void SendSNEventHasReturn()
        {
            ISNEvent testInsintace = new SNEvent();

            Func <int> voidFc = () => {
                return(1);
            };

            testInsintace.Register(SNMsg.ExampleMsg, voidFc);

            testInsintace.DispatchHasReturn <int> (SNMsg.ExampleMsg, ref item);
            Assert.AreEqual(item, 1);
        }