Assert.True 方法

定义

重载

True(Boolean, String)

断言条件为 true。 如果条件为 false,则方法将 AssertionException引发 。

True(Boolean)

断言条件为 true。 如果条件为 false,则方法将 AssertionException引发 。

True(Boolean, String, Object[])

断言条件为 true。 如果条件为 false,则方法将 AssertionException引发 。

True(Boolean, String)

断言条件为 true。 如果条件为 false,则方法将 AssertionException引发 。

public static void True (bool condition, string message);
static member True : bool * string -> unit

参数

condition
Boolean

计算的条件

message
String

条件为 false 时要显示的消息

适用于

True(Boolean)

断言条件为 true。 如果条件为 false,则方法将 AssertionException引发 。

public static void True (bool condition);
static member True : bool -> unit

参数

condition
Boolean

计算的条件

适用于

True(Boolean, String, Object[])

断言条件为 true。 如果条件为 false,则方法将 AssertionException引发 。

public static void True (bool condition, string message, params object[] args);
static member True : bool * string * obj[] -> unit

参数

condition
Boolean

计算的条件

message
String

条件为 false 时要显示的消息

args
Object[]

设置消息格式时要使用的参数

适用于