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()); }
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()); }
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()); }