Defines a test task for a mod
public abstract class ModTest : BTD_Mod_Helper.Api.ModContent
Inheritance System.Object ModContent ModTest
Whether the current run of this test has completed
public bool Completed { get; set; }
Exception that happened in the most recent run of this test, if any
public System.Exception Exception { get; set; }
Whether the most recent run of this test failed to complete successfully
public bool Failed { get; }
Whether the most recent run of this test completed successfully
public bool Suceeded { get; }
Throws an BTD_Mod_Helper.Api.ModTest.AssertException if the given condition is not true
public void Assert(bool condition, string message="");
condition System.Boolean
Condition that must be true for the test to continue
message System.String
Optional message describing the failure
Throws an BTD_Mod_Helper.Api.ModTest.AssertException if no UnityEngine.Component of type T
with the given name can be found within any currently loaded scene
public T AssertComponentExists<T>(string name, string message="")
where T : Component;
T
Component type to search for
name System.String
Name of the GameObject the component should be attached to
message System.String
Optional message describing the failure
Throws an BTD_Mod_Helper.Api.ModTest.AssertException if the two given objects are not equal
public void AssertEquals(object o1, object o2, string message="");
First object to compare
Second object to compare
message System.String
Optional message describing the failure
Throws an BTD_Mod_Helper.Api.ModTest.AssertException if the given action does not throw an exception
public void AssertThrows(System.Action action, string message="");
action System.Action
Action that is expected to throw
message System.String
Optional message describing the failure
Throws an BTD_Mod_Helper.Api.ModTest.AssertException if the given action does not throw an exception of type T
public void AssertThrows<T>(System.Action action, string message="");
T
Type of exception that the action is expected to throw
action System.Action
Action that is expected to throw
message System.String
Optional message describing the failure
Ensures that the game is on the main menu screen with no popups before continuing
public System.Collections.IEnumerator EnsureOnMainMenuWithNoPopUps();
System.Collections.IEnumerator
Unconditionally fails the test with the given message
public void Fail(string message="");
message System.String
Optional message describing the failure
Loads the game into a real match of BTD6
public System.Collections.IEnumerator LoadIntoGame(InGameData inGameData);
inGameData Il2CppAssets.Scripts.Unity.UI_New.InGame.InGameData
specifics about game type
System.Collections.IEnumerator
Runs the test coroutine
public System.Collections.IEnumerator RunTest();
System.Collections.IEnumerator
Primary test coroutine
public abstract System.Collections.IEnumerator Test();
System.Collections.IEnumerator
Records and throws the given exception, causing the test to fail
public void Throw(System.Exception e);
Wraps a coroutine so that the test will fail if it does not complete within the given time
public System.Collections.IEnumerator Timeout(object coroutine, float seconds);
coroutine System.Object
Coroutine (managed or Il2Cpp) or yield value to run with a timeout
seconds System.Single
Maximum number of seconds the coroutine is allowed to run for