コード例 #1
0
        public void TestRoutedEvents()
        {
            var routedEvent = new EventRouter <string>();

            var assertionCount = 0;

            var assertionIncrementCheck = new Action <Action>((a) =>
            {
                var origCount = assertionCount;
                a();
                Assert.AreEqual(origCount + 1, assertionCount);
            });

            routedEvent.RegisterOnce("Home/{Page}", (args) =>
            {
                Assert.AreEqual("thepage", args.RouteVariables["page"]);
                Assert.AreEqual(args.Data, "Foo");
                assertionCount++;
            });

            assertionIncrementCheck(() =>
            {
                routedEvent.Route("Home/ThePage", "Foo");
            });
            Console.WriteLine(assertionCount);
        }
コード例 #2
0
 public void Route(string messageTypeName, MultiPlayerMessage message) => innerRouter.Route(messageTypeName, message);