using System; namespace TechbloxModdingAPI.Tests { /// /// Test type. /// When provided to APITestCaseAttribute, this dictates when the test case is called. /// public enum TestType { Menu, Game, SimulationMode, EditMode, } /// /// API Test Class attribute. /// Classes without this attribute will be ignored when searching for test cases. /// [AttributeUsage(AttributeTargets.Class)] public class APITestClassAttribute : Attribute { internal string Name; public APITestClassAttribute(string name = "") { this.Name = name; } } /// /// API Test Case attribute. /// Static methods with this attribute will be called when the API test system is running. /// [AttributeUsage(AttributeTargets.Method)] public class APITestCaseAttribute : Attribute { internal TestType TestType; public APITestCaseAttribute(TestType testType) { this.TestType = testType; } } /// /// API Test StartUp attribute. /// Static methods with this attribute will be called before any test case is run by the API test system. /// [AttributeUsage(AttributeTargets.Method)] public class APITestStartUpAttribute : Attribute { } /// /// API Test TearDown attribute. /// Static methods with this attribute will be called after all API test system test cases have completed (failed or succeeded). /// [AttributeUsage(AttributeTargets.Method)] public class APITestTearDownAttribute : Attribute { } }