Assert.True 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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[]
设置消息格式时要使用的参数