Esempio n. 1
0
        public void CreateWithNestedParameters()
        {
            var gameEvent = new GameEvent("myEvent");

            gameEvent.AddParam("level1", new Dictionary <string, object>()
            {
                { "level2", new Dictionary <string, object>()
                  {
                      { "yo!", "greeting" }
                  } }
            });

            CollectionAssert.AreEquivalent(new Dictionary <string, object>()
            {
                { "eventName", "myEvent" },
                { "eventParams", new Dictionary <string, object>()
                  {
                      { "level1", new Dictionary <string, object>()
                        {
                            { "level2", new Dictionary <string, object>()
                                {
                                    { "yo!", "greeting" }
                                } }
                        } }
                  } }
            }, gameEvent.AsDictionary());
        }
Esempio n. 2
0
        public void CreateWithoutParameters()
        {
            var gameEvent = new GameEvent("myEvent");

            Assert.IsNotNull(gameEvent);
            CollectionAssert.AreEquivalent(new Dictionary <string, object>()
            {
                { "eventName", "myEvent" },
                { "eventParams", new Dictionary <string, object>()
                  {
                  } }
            }, gameEvent.AsDictionary());
        }
Esempio n. 3
0
        public void CreateWithParameters()
        {
            var gameEvent = new GameEvent("myEvent");

            gameEvent.AddParam("level", 5);
            gameEvent.AddParam("ending", "Kaboom!");

            CollectionAssert.AreEquivalent(new Dictionary <string, object>()
            {
                { "eventName", "myEvent" },
                { "eventParams", new Dictionary <string, object>()
                  {
                      { "level", 5 },
                      { "ending", "Kaboom!" }
                  } }
            }, gameEvent.AsDictionary());
        }