共用方式為


Assert.Fail Method

Definition

Overloads

Fail(String)

Throws an AssertFailedException.

Fail()

Throws an AssertFailedException.

Fail(String, Object[])

Throws an AssertFailedException.

Fail(String)

Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs

Throws an AssertFailedException.

public static void Fail (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 to include in the exception. The message is shown in test results.

Exceptions

Always thrown.

Applies to

Fail()

Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs

Throws an AssertFailedException.

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

Exceptions

Always thrown.

Applies to

Fail(String, Object[])

Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs
Source:
Assert.Fail.cs

Throws an AssertFailedException.

public static void Fail (string message, params object[] parameters);
public static void Fail (string? message, params object?[]? parameters);
static member Fail : string * obj[] -> unit
Public Shared Sub Fail (message As String, ParamArray parameters As Object())

Parameters

message
String

The message to include in the exception. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Always thrown.

Applies to