65 lines
1.6 KiB
C#
65 lines
1.6 KiB
C#
using System;
|
|
namespace GamecraftModdingAPI.Tests
|
|
{
|
|
/// <summary>
|
|
/// Test type.
|
|
/// When provided to APITestCaseAttribute, this dictates when the test case is called.
|
|
/// </summary>
|
|
public enum TestType
|
|
{
|
|
Menu,
|
|
Game,
|
|
SimulationMode,
|
|
EditMode,
|
|
}
|
|
|
|
/// <summary>
|
|
/// API Test Class attribute.
|
|
/// Classes without this attribute will be ignored when searching for test cases.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Class)]
|
|
public class APITestClassAttribute : Attribute
|
|
{
|
|
internal string Name;
|
|
|
|
public APITestClassAttribute(string name = "")
|
|
{
|
|
this.Name = name;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// API Test Case attribute.
|
|
/// Static methods with this attribute will be called when the API test system is running.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Method)]
|
|
public class APITestCaseAttribute : Attribute
|
|
{
|
|
internal TestType TestType;
|
|
|
|
public APITestCaseAttribute(TestType testType)
|
|
{
|
|
this.TestType = testType;
|
|
}
|
|
}
|
|
|
|
/// <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>
|
|
[AttributeUsage(AttributeTargets.Method)]
|
|
public class APITestStartUpAttribute : Attribute
|
|
{
|
|
|
|
}
|
|
|
|
/// <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>
|
|
[AttributeUsage(AttributeTargets.Method)]
|
|
public class APITestTearDownAttribute : Attribute
|
|
{
|
|
|
|
}
|
|
}
|