Class ContractHelpers
A collection of functions that help enforce contracts.
Inherited Members
Namespace: Flame
Assembly: Flame.dll
Syntax
public static class ContractHelpers
Methods
| Edit this page View SourceAssert(bool)
Asserts that a condition must always hold.
Declaration
public static void Assert(bool condition)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | condition | A condition that must be true. |
Assert(bool, string)
Asserts that a condition must always hold.
Declaration
public static void Assert(bool condition, string message)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | condition | A condition that must be true. |
| string | message | The error message to print if the condition is false. |
CheckPositive(int, string)
Checks that an integer value is positive, i.e., it is greater than or equal to zero.
Declaration
public static void CheckPositive(int value, string valueName)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | The value to check. |
| string | valueName | The name of the value to check. |