Exemple #1
0
        public void SendSNEventTest0()
        {
            ISNEvent testInsintace = new SNEvent();
            int      param         = 0;

            Action voidAc = () => {
                param = 1;
            };

            testInsintace.Register(SNMsg.ExampleMsg, voidAc);
            testInsintace.Dispatch(SNMsg.ExampleMsg);
            Assert.AreEqual(param, 1);
        }
Exemple #2
0
        public void SendSNEventTest1()
        {
            ISNEvent testInsintace = new SNEvent();
            int      param         = 0;

            Action <int> voidAc1 = (int i) => {
                param = i;
            };

            testInsintace.Register(SNMsg.ExampleMsg, voidAc1);
            testInsintace.Dispatch(SNMsg.ExampleMsg, 1);
            Assert.AreEqual(param, 1);
        }
Exemple #3
0
        public void SendSNEventTest2()
        {
            ISNEvent testInsintace = new SNEvent();
            string   str           = "";
            int      param         = 0;

            Action <string, int> voidAc2 = (string s, int i) => {
                str   = "1";
                param = 1;
            };

            testInsintace.Register(SNMsg.ExampleMsg, voidAc2);
            testInsintace.Dispatch(SNMsg.ExampleMsg, "1", 1);
            Assert.AreEqual(param, 1);
            Assert.AreEqual(str, "1");
        }
Exemple #4
0
        public void SendSNEventTest5()
        {
            ISNEvent testInsintace = new SNEvent();
            string   str           = "";
            int      param         = 0;
            int      param2        = 0;
            int      param3        = 0;
            int      param4        = 0;

            SNFramework.Action <string, int, int, int, int> voidAc5 = (string s, int i, int p3, int p4, int p5) => {
                str    = "1";
                param  = 1;
                param2 = 1;
                param3 = 1;
                param4 = 1;
            };
            testInsintace.Register(SNMsg.ExampleMsg, voidAc5);
            testInsintace.Dispatch(SNMsg.ExampleMsg, "1", 1, 1, 1, 1);
            Assert.AreEqual(param, 1);
            Assert.AreEqual(str, "1");
            Assert.AreEqual(param2, 1);
            Assert.AreEqual(param3, 1);
            Assert.AreEqual(param4, 1);
        }