Example #1
0
            public void Call()
            {
                bool   called = false;
                string topic  = null;
                var    se     = SubscribeEventWithTopic.Create("topic1", (t) => {
                    called = true;
                    topic  = t;
                });

                se.Call("dummy call topic", new object[] {});
                Assert.IsTrue(called);
                Assert.AreEqual(topic, "dummy call topic");
            }
Example #2
0
            public void Call()
            {
                bool   called = false;
                string topic  = null;
                int    arg1   = 0;
                var    se     = SubscribeEventWithTopic.Create("topic1", (string t, int a1) => {
                    called = true;
                    topic  = t;
                    arg1   = a1;
                });

                se.Call("dummy call topic", new object[] { 192 });
                Assert.IsTrue(called);
                Assert.AreEqual(topic, "dummy call topic");
                Assert.AreEqual(arg1, 192);
            }
Example #3
0
            public void Create()
            {
                var se = SubscribeEventWithTopic.Create("topic1", (string t, int a1, string a2) => {});

                Assert.AreEqual(se.Topics[0], "topic1");
            }
Example #4
0
 public SubscribeEventChain SubscribeWithTopic <T1, T2, T3>(string[] topics, Action <string, T1, T2, T3> callback)
 {
     return(Subscribe(SubscribeEventWithTopic.Create(topics, callback)));
 }
Example #5
0
 public SubscribeEventChain SubscribeWithTopic <T1>(string topic, Action <string, T1> callback)
 {
     return(Subscribe(SubscribeEventWithTopic.Create(topic, callback)));
 }