Class Assert
Provides a set of methods that are compiled in debug mode only and throw exceptions, if specific condition is not true.
Inherited Members
Namespace: Nevatech.Vsb.Repository.Diagnostics
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public static class Assert
Methods
Fail()
In debug mode throws InvalidOperationException.
Declaration
[Conditional("DEBUG")]
public static void Fail()
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Always thrown. |
Fail(Exception)
In debug mode thows provided Exception.
Declaration
[Conditional("DEBUG")]
public static void Fail(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Exception to be thrown. |
Fail(String, Object[])
In debug mode throws InvalidOperationException.
Declaration
[Conditional("DEBUG")]
public static void Fail(string message, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
String | message | Message that describes the problem that may include formatting placeholders. |
Object[] | args | Format string parameters. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Always thrown. |
IsFalse(Boolean)
In debug mode throws InvalidOperationException, if specific condition is evaluated to true.
Declaration
[Conditional("DEBUG")]
public static void IsFalse(bool condition)
Parameters
Type | Name | Description |
---|---|---|
Boolean | condition | Condition to be evaluated. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown, if provided condition is true. |
IsFalse(Boolean, String, Object[])
In debug mode throws InvalidOperationException, if specific condition is evaluated to true.
Declaration
[Conditional("DEBUG")]
public static void IsFalse(bool condition, string message, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
Boolean | condition | Condition to be evaluated. |
String | message | Message that describes the problem that may include formatting placeholders. |
Object[] | args | Format string parameters. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown, if provided condition is true. |
IsTrue(Boolean)
In debug mode throws InvalidOperationException, if specific condition is evaluated to false.
Declaration
[Conditional("DEBUG")]
public static void IsTrue(bool condition)
Parameters
Type | Name | Description |
---|---|---|
Boolean | condition | Condition to be evaluated. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown, if provided condition is false. |
IsTrue(Boolean, String, Object[])
In debug mode throws InvalidOperationException, if specific condition is evaluated to false.
Declaration
[Conditional("DEBUG")]
public static void IsTrue(bool condition, string message, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
Boolean | condition | Condition to be evaluated. |
String | message | Message that describes the problem that may include formatting placeholders. |
Object[] | args | Format string parameters. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown, if provided condition is false. |