C# Class Machine.Fakes.Sdk.Guard

Container class for (as it name implies) guard clauses.
ファイルを表示 Open project: machine/machine.fakes

Public Methods

Method Description
AgainstArgumentNull ( object argument, string argumentName ) : void

Verifies that the argument supplied by argument is not null.

AgainstNullOrEmptyString ( string argument, string argumentName ) : void

Verifies that the argument supplied by argument is neither null nor an empty String.

ArgumentAssignableTo ( Type argument, Type assignmentTargetType ) : void

Verifies that the type supplied by argument is assignable to the type specified by assignmentTargetType.

Method Details

AgainstArgumentNull() public static method

Verifies that the argument supplied by argument is not null.
/// Thrown when is null. ///
public static AgainstArgumentNull ( object argument, string argumentName ) : void
argument object The object to be checked.
argumentName string The name of the object that will be used when raising an .
return void

AgainstNullOrEmptyString() public static method

Verifies that the argument supplied by argument is neither null nor an empty String.
/// Thrown when is null or an empty . ///
public static AgainstNullOrEmptyString ( string argument, string argumentName ) : void
argument string The object to be checked.
argumentName string The name of the object that will be used when raising an .
return void

ArgumentAssignableTo() public static method

Verifies that the type supplied by argument is assignable to the type specified by assignmentTargetType.
/// Thrown when is not assignable to . ///
public static ArgumentAssignableTo ( Type argument, Type assignmentTargetType ) : void
argument System.Type The type to be checked.
assignmentTargetType System.Type The target type.
return void