Photon Quantum 3.0.0

Static Public Member Functions | List of all members
Quantum.Assert Class Reference

Provides methods for asserting conditions. Throws an AssertException when a condition is not met. Methods are only invoked in DEBUG builds unless otherwise specified. More...

Static Public Member Functions

static void Always ([DoesNotReturnIf(false)] bool condition)
 Throws an AssertException with a message if the condition is false, even in non-DEBUG builds. More...
 
static void Always ([DoesNotReturnIf(false)] bool condition, string error)
 Throws an AssertException with a message if condition is false, even in non-DEBUG builds. More...
 
static void Always< T0 > ([DoesNotReturnIf(false)] bool condition, string format, T0 arg0)
 Throws an AssertException with a message if condition is false, even in non-DEBUG builds. More...
 
static void Always< T0 > ([DoesNotReturnIf(false)] bool condition, T0 arg0)
 Throws an AssertException with a message if the condition is false, even in non-DEBUG builds. The message is composed from additional arguments. More...
 
static void Always< T0, T1 > ([DoesNotReturnIf(false)] bool condition, string format, T0 arg0, T1 arg1)
 Throws an AssertException with a message if condition is false, even in non-DEBUG builds. More...
 
static void Always< T0, T1 > ([DoesNotReturnIf(false)] bool condition, T0 arg0, T1 arg1)
 Throws an AssertException with a message if the condition is false, even in non-DEBUG builds. The message is composed from additional arguments. More...
 
static void Always< T0, T1, T2 > ([DoesNotReturnIf(false)] bool condition, string format, T0 arg0, T1 arg1, T2 arg2)
 Throws an AssertException with a message if condition is false, even in non-DEBUG builds. More...
 
static void Always< T0, T1, T2 > ([DoesNotReturnIf(false)] bool condition, T0 arg0, T1 arg1, T2 arg2)
 Throws an AssertException with a message if the condition is false, even in non-DEBUG builds. The message is composed from additional arguments. More...
 
static void Always< T0, T1, T2, T3 > ([DoesNotReturnIf(false)] bool condition, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 Throws an AssertException with a message if condition is false, even in non-DEBUG builds. More...
 
static void Always< T0, T1, T2, T3 > ([DoesNotReturnIf(false)] bool condition, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 Throws an AssertException with a message if the condition is false, even in non-DEBUG builds. The message is composed from additional arguments. More...
 
static void AlwaysFail ()
 Throws an AssertException, even in non-DEBUG builds. More...
 
static void AlwaysFail (object error)
 Throws an AssertException with a message, even in non-DEBUG builds. More...
 
static void AlwaysFail (string error)
 Throws an AssertException with a message, even in non-DEBUG builds. More...
 
static void AlwaysFail< T > (T error)
 Throws an AssertException with a message, even in non-DEBUG builds. More...
 
static void Check ([DoesNotReturnIf(false)] bool condition)
 Throws an AssertException if the condition is false More...
 
static void Check ([DoesNotReturnIf(false)] bool condition, string error)
 Throws an AssertException with a message if the condition is false More...
 
static void Check (object condition)
 Throws an AssertException if the condition is null More...
 
static unsafe void Check (void *condition)
 Throws an AssertException if the condition is null More...
 
static void Check< T0 > ([DoesNotReturnIf(false)] bool condition, string format, T0 arg0)
 Throws an AssertException with a message if the condition is false More...
 
static void Check< T0 > ([DoesNotReturnIf(false)] bool condition, T0 arg0)
 Throws an AssertException with a message if the condition is false. The message is composed from additional arguments. More...
 
static void Check< T0, T1 > ([DoesNotReturnIf(false)] bool condition, string format, T0 arg0, T1 arg1)
 Throws an AssertException with a message if the condition is false More...
 
static void Check< T0, T1 > ([DoesNotReturnIf(false)] bool condition, T0 arg0, T1 arg1)
 Throws an AssertException with a message if the condition is false. The message is composed from additional arguments. More...
 
static void Check< T0, T1, T2 > ([DoesNotReturnIf(false)] bool condition, string format, T0 arg0, T1 arg1, T2 arg2)
 Throws an AssertException with a message if the condition is false More...
 
static void Check< T0, T1, T2 > ([DoesNotReturnIf(false)] bool condition, T0 arg0, T1 arg1, T2 arg2)
 Throws an AssertException with a message if the condition is false. The message is composed from additional arguments. More...
 
static void Check< T0, T1, T2, T3 > ([DoesNotReturnIf(false)] bool condition, string format, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 Throws an AssertException with a message if the condition is false More...
 
static void Check< T0, T1, T2, T3 > ([DoesNotReturnIf(false)] bool condition, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
 Throws an AssertException with a message if the condition is false. The message is composed from additional arguments. More...
 
static void Check< T0, T1, T2, T3, T4 > ([DoesNotReturnIf(false)] bool condition, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
 Throws an AssertException with a message if the condition is false. The message is composed from additional arguments. More...
 
static void Fail ()
 Always throws an AssertException. More...
 
static void Fail (string error)
 Always throws an AssertException with a message. More...
 
static void Fail (string format, params object[] args)
 Always throws an AssertException with a message. More...
 

Detailed Description

Provides methods for asserting conditions. Throws an AssertException when a condition is not met. Methods are only invoked in DEBUG builds unless otherwise specified.

Member Function Documentation

◆ Fail() [1/3]

static void Quantum.Assert.Fail ( )
inlinestatic

Always throws an AssertException.

Exceptions
AssertException

◆ Fail() [2/3]

static void Quantum.Assert.Fail ( string  error)
inlinestatic

Always throws an AssertException with a message.

Parameters
errorAn error message
Exceptions
AssertException

◆ Fail() [3/3]

static void Quantum.Assert.Fail ( string  format,
params object[]  args 
)
inlinestatic

Always throws an AssertException with a message.

Template Parameters
T0
Parameters
formatAn error message format
args
Exceptions
AssertException

◆ Check() [1/4]

static void Quantum.Assert.Check ( object  condition)
inlinestatic

Throws an AssertException if the condition is null

Parameters
conditionValue to check
Exceptions
AssertException

◆ Check() [2/4]

static unsafe void Quantum.Assert.Check ( void *  condition)
inlinestatic

Throws an AssertException if the condition is null

Parameters
conditionValue to check
Exceptions
AssertException

◆ Check() [3/4]

static void Quantum.Assert.Check ( [DoesNotReturnIf(false)] bool  condition)
inlinestatic

Throws an AssertException if the condition is false

Parameters
conditionValue to check
Exceptions
AssertException

◆ Check() [4/4]

static void Quantum.Assert.Check ( [DoesNotReturnIf(false)] bool  condition,
string  error 
)
inlinestatic

Throws an AssertException with a message if the condition is false

Parameters
conditionValue to check
errorAn error message
Exceptions
AssertException

◆ Check< T0 >() [1/2]

static void Quantum.Assert.Check< T0 > ( [DoesNotReturnIf(false)] bool  condition,
string  format,
T0  arg0 
)
inlinestatic

Throws an AssertException with a message if the condition is false

Parameters
conditionValue to check
formatAn error message format
Exceptions
AssertException

◆ Check< T0, T1 >() [1/2]

static void Quantum.Assert.Check< T0, T1 > ( [DoesNotReturnIf(false)] bool  condition,
string  format,
T0  arg0,
T1  arg1 
)
inlinestatic

Throws an AssertException with a message if the condition is false

Parameters
conditionValue to check
formatAn error message format
Exceptions
AssertException

◆ Check< T0, T1, T2 >() [1/2]

static void Quantum.Assert.Check< T0, T1, T2 > ( [DoesNotReturnIf(false)] bool  condition,
string  format,
T0  arg0,
T1  arg1,
T2  arg2 
)
inlinestatic

Throws an AssertException with a message if the condition is false

Parameters
conditionValue to check
formatAn error message format
Exceptions
AssertException

◆ Check< T0, T1, T2, T3 >() [1/2]

static void Quantum.Assert.Check< T0, T1, T2, T3 > ( [DoesNotReturnIf(false)] bool  condition,
string  format,
T0  arg0,
T1  arg1,
T2  arg2,
T3  arg3 
)
inlinestatic

Throws an AssertException with a message if the condition is false

Parameters
conditionValue to check
formatAn error message format
Exceptions
AssertException

◆ Check< T0 >() [2/2]

static void Quantum.Assert.Check< T0 > ( [DoesNotReturnIf(false)] bool  condition,
T0  arg0 
)
inlinestatic

Throws an AssertException with a message if the condition is false. The message is composed from additional arguments.

Template Parameters
T0
Parameters
conditionValue to check
Exceptions
AssertException

◆ Check< T0, T1 >() [2/2]

static void Quantum.Assert.Check< T0, T1 > ( [DoesNotReturnIf(false)] bool  condition,
T0  arg0,
T1  arg1 
)
inlinestatic

Throws an AssertException with a message if the condition is false. The message is composed from additional arguments.

Parameters
conditionValue to check
Exceptions
AssertException

◆ Check< T0, T1, T2 >() [2/2]

static void Quantum.Assert.Check< T0, T1, T2 > ( [DoesNotReturnIf(false)] bool  condition,
T0  arg0,
T1  arg1,
T2  arg2 
)
inlinestatic

Throws an AssertException with a message if the condition is false. The message is composed from additional arguments.

Parameters
conditionValue to check
Exceptions
AssertException

◆ Check< T0, T1, T2, T3 >() [2/2]

static void Quantum.Assert.Check< T0, T1, T2, T3 > ( [DoesNotReturnIf(false)] bool  condition,
T0  arg0,
T1  arg1,
T2  arg2,
T3  arg3 
)
inlinestatic

Throws an AssertException with a message if the condition is false. The message is composed from additional arguments.

Parameters
conditionValue to check
Exceptions
AssertException

◆ Check< T0, T1, T2, T3, T4 >()

static void Quantum.Assert.Check< T0, T1, T2, T3, T4 > ( [DoesNotReturnIf(false)] bool  condition,
T0  arg0,
T1  arg1,
T2  arg2,
T3  arg3,
T4  arg4 
)
inlinestatic

Throws an AssertException with a message if the condition is false. The message is composed from additional arguments.

Parameters
conditionValue to check
Exceptions
AssertException

◆ AlwaysFail() [1/3]

static void Quantum.Assert.AlwaysFail ( )
inlinestatic

Throws an AssertException, even in non-DEBUG builds.

◆ AlwaysFail() [2/3]

static void Quantum.Assert.AlwaysFail ( string  error)
inlinestatic

Throws an AssertException with a message, even in non-DEBUG builds.

Parameters
errorAn error message
Exceptions
AssertException

◆ AlwaysFail() [3/3]

static void Quantum.Assert.AlwaysFail ( object  error)
inlinestatic

Throws an AssertException with a message, even in non-DEBUG builds.

Parameters
errorAn error message
Exceptions
AssertException

◆ AlwaysFail< T >()

static void Quantum.Assert.AlwaysFail< T > ( error)
inlinestatic

Throws an AssertException with a message, even in non-DEBUG builds.

Parameters
errorAn error message
Exceptions
AssertException
Type Constraints
T :struct 

◆ Always() [1/2]

static void Quantum.Assert.Always ( [DoesNotReturnIf(false)] bool  condition)
inlinestatic

Throws an AssertException with a message if the condition is false, even in non-DEBUG builds.

Parameters
conditionValue to check
Exceptions
AssertException

◆ Always() [2/2]

static void Quantum.Assert.Always ( [DoesNotReturnIf(false)] bool  condition,
string  error 
)
inlinestatic

Throws an AssertException with a message if condition is false, even in non-DEBUG builds.

Parameters
conditionValue to check
errorAn error message
Exceptions
AssertException

◆ Always< T0 >() [1/2]

static void Quantum.Assert.Always< T0 > ( [DoesNotReturnIf(false)] bool  condition,
string  format,
T0  arg0 
)
inlinestatic

Throws an AssertException with a message if condition is false, even in non-DEBUG builds.

Parameters
conditionValue to check
formatAn error message format
Exceptions
AssertException

◆ Always< T0, T1 >() [1/2]

static void Quantum.Assert.Always< T0, T1 > ( [DoesNotReturnIf(false)] bool  condition,
string  format,
T0  arg0,
T1  arg1 
)
inlinestatic

Throws an AssertException with a message if condition is false, even in non-DEBUG builds.

Parameters
conditionValue to check
formatAn error message format
Exceptions
AssertException

◆ Always< T0, T1, T2 >() [1/2]

static void Quantum.Assert.Always< T0, T1, T2 > ( [DoesNotReturnIf(false)] bool  condition,
string  format,
T0  arg0,
T1  arg1,
T2  arg2 
)
inlinestatic

Throws an AssertException with a message if condition is false, even in non-DEBUG builds.

Parameters
conditionValue to check
formatAn error message format
Exceptions
AssertException

◆ Always< T0, T1, T2, T3 >() [1/2]

static void Quantum.Assert.Always< T0, T1, T2, T3 > ( [DoesNotReturnIf(false)] bool  condition,
string  format,
T0  arg0,
T1  arg1,
T2  arg2,
T3  arg3 
)
inlinestatic

Throws an AssertException with a message if condition is false, even in non-DEBUG builds.

Parameters
conditionValue to check
formatAn error message format
Exceptions
AssertException

◆ Always< T0 >() [2/2]

static void Quantum.Assert.Always< T0 > ( [DoesNotReturnIf(false)] bool  condition,
T0  arg0 
)
inlinestatic

Throws an AssertException with a message if the condition is false, even in non-DEBUG builds. The message is composed from additional arguments.

Parameters
conditionValue to check
Exceptions
AssertException

◆ Always< T0, T1 >() [2/2]

static void Quantum.Assert.Always< T0, T1 > ( [DoesNotReturnIf(false)] bool  condition,
T0  arg0,
T1  arg1 
)
inlinestatic

Throws an AssertException with a message if the condition is false, even in non-DEBUG builds. The message is composed from additional arguments.

Parameters
conditionValue to check
Exceptions
AssertException

◆ Always< T0, T1, T2 >() [2/2]

static void Quantum.Assert.Always< T0, T1, T2 > ( [DoesNotReturnIf(false)] bool  condition,
T0  arg0,
T1  arg1,
T2  arg2 
)
inlinestatic

Throws an AssertException with a message if the condition is false, even in non-DEBUG builds. The message is composed from additional arguments.

Parameters
conditionValue to check
Exceptions
AssertException

◆ Always< T0, T1, T2, T3 >() [2/2]

static void Quantum.Assert.Always< T0, T1, T2, T3 > ( [DoesNotReturnIf(false)] bool  condition,
T0  arg0,
T1  arg1,
T2  arg2,
T3  arg3 
)
inlinestatic

Throws an AssertException with a message if the condition is false, even in non-DEBUG builds. The message is composed from additional arguments.

Parameters
conditionValue to check
Exceptions
AssertException