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