public static abstract sealed class Sandbox.Diagnostics.Assert
Related Guides
Broader workflow and conceptual references connected to this API.
Sometimes you know what you're looking for, but you don't know where it is.
A prefab is a GameObject that can be used in multiple places. They're usually used to contain an object that is used across multiple scenes, or needs to be instantiated at runtime.
If you add a UnitTests directory to your project folder, we will automatically generate a Unit Test project for you. In order for the project to be generated you need to restart your editor if you have it open.
Methods
Showing 9 methods
public static void AreEqual(T a, T b, string message = null)
Throws an exception when the 2 given objects are not equal to each other.
Parameters
a: Object A to test.b: Object B to test.message: Message to include in the exception, if any. Default: null
Exceptions
| Exception | Condition |
|---|---|
Exception | Thrown when 2 given objects are not equal |
public static void AreNotEqual(T a, T b, string message = null)
Throws an exception when the 2 given objects are equal to each other.
Parameters
message: Default: null
public static void False(bool isValid, string message = null)
Throws an exception when given expression does not resolve to false.
Parameters
isValid: The expression to testmessage: Message to include in the exception, if any. Default: null
Exceptions
| Exception | Condition |
|---|---|
Exception | Thrown when given expression is not false. |
public static void IsValid(Sandbox.IValid obj)
Throws an exception when the given object is not valid.
public static void True(bool isValid, string message = null)
Throws an exception when given expression does not resolve to true.
Parameters
isValid: The expression to testmessage: Message to include in the exception, if any. Default: null
Exceptions
| Exception | Condition |
|---|---|
Exception | Thrown when given expression is not true. |
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox.Diagnostics |
| Type | class |
| Assembly | Sandbox.System |
| Doc ID | T:Sandbox.Diagnostics.Assert |