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