Compartilhar via


PexAssert.Fail Method

Definition

Overloads

Fail(String, Object[])

Asserts unconditionally, with a specified message and formatting for the exception object.

Fail(Exception, String)

Asserts unconditionally.

Fail(String)

Asserts unconditionally, with a specified message in the exception object.

Fail()

Asserts Fail unconditionally. Test will throw a PexAssertFailedException.

Fail(String, Object[])

Asserts unconditionally, with a specified message and formatting for the exception object.

public:
 static void Fail(System::String ^ format, ... cli::array <System::Object ^> ^ args);
public static void Fail (string format, params object[] args);
static member Fail : string * obj[] -> unit
Public Shared Sub Fail (format As String, ParamArray args As Object())

Parameters

format
String

A message format string. The syntax for this string is identical to the format string used by Console.Writeline. In particular, insert "{0}", "{1}" and so on at appropriate locations in the string to represent the values of the variables in the args array.

args
Object[]

One or more variables. whose values are to be inserted in format.

Exceptions

Always thrown.

Applies to

Fail(Exception, String)

Asserts unconditionally.

public:
 static void Fail(Exception ^ ex, System::String ^ message);
public static void Fail (Exception ex, string message);
static member Fail : Exception * string -> unit
Public Shared Sub Fail (ex As Exception, message As String)

Parameters

ex
Exception

inner exception

message
String

Message to be displayed on failure.

Exceptions

Always thrown.

Applies to

Fail(String)

Asserts unconditionally, with a specified message in the exception object.

public:
 static void Fail(System::String ^ message);
public static void Fail (string message);
static member Fail : string -> unit
Public Shared Sub Fail (message As String)

Parameters

message
String

The message string.

Exceptions

Always thrown.

Applies to

Fail()

Asserts Fail unconditionally. Test will throw a PexAssertFailedException.

public:
 static void Fail();
public static void Fail ();
static member Fail : unit -> unit
Public Shared Sub Fail ()

Exceptions

Always thrown.

Applies to