using System; using GamecraftModdingAPI.Tests; namespace GamecraftModdingAPI.App { #if TEST /// <summary> /// App callbacks tests. /// Only available in TEST builds. /// </summary> [APITestClass] public static class AppCallbacksTest { [APITestStartUp] public static void StartUp() { // this could be split into 6 separate test cases Game.Enter += Assert.CallsBack<GameEventArgs>("GameEnter"); Game.Exit += Assert.CallsBack<GameEventArgs>("GameExit"); Game.Simulate += Assert.CallsBack<GameEventArgs>("GameSimulate"); Game.Edit += Assert.CallsBack<GameEventArgs>("GameEdit"); Client.EnterMenu += Assert.CallsBack<MenuEventArgs>("MenuEnter"); Client.ExitMenu += Assert.CallsBack<MenuEventArgs>("MenuExit"); } [APITestCase(TestType.Game)] public static void Test() { // the test is actually completely implemented in StartUp() // this is here just so it looks less weird (not required) } } #endif }