Assert.IsFalse Method

Definition

Overloads

IsFalse(Nullable<Boolean>, String, String)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Boolean, String, Object[])

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, String, Object[])

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, Assert+AssertIsFalseInterpolatedStringHandler, String)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, String)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Boolean)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Boolean, String)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Boolean, Assert+AssertIsFalseInterpolatedStringHandler)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, Assert+AssertIsFalseInterpolatedStringHandler)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, String, String)

Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool? condition, string? message = "", string conditionExpression = "");

Parameters

condition
Nullable<Boolean>

The condition the test expects to be false.

message
String

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

conditionExpression
String

The syntactic expression of condition as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Exceptions

Thrown if condition is true.

Applies to

MSTest.TestFramework 4.0.0
产品 版本
MSTest.TestFramework 4.0.0

IsFalse(Boolean, String, Object[])

Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool condition, string message, params object[] parameters);
C#
public static void IsFalse(bool condition, string? message, params object?[]? parameters);

Parameters

condition
Boolean

The condition the test expects to be false.

message
String

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

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if condition is true.

Applies to

MSTest.TestFramework 3.11.0 和其他版本
产品 版本
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.3, 3.9.3, 3.10.5, 3.11.0

IsFalse(Nullable<Boolean>, String, Object[])

Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool? condition, string message, params object[] parameters);
C#
public static void IsFalse(bool? condition, string? message, params object?[]? parameters);

Parameters

condition
Nullable<Boolean>

The condition the test expects to be false.

message
String

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

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if condition is true.

Applies to

MSTest.TestFramework 3.11.0 和其他版本
产品 版本
MSTest.TestFramework 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.3, 3.9.3, 3.10.5, 3.11.0

IsFalse(Nullable<Boolean>, Assert+AssertIsFalseInterpolatedStringHandler, String)

Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool? condition, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsFalseInterpolatedStringHandler message, string conditionExpression = "");

Parameters

condition
Nullable<Boolean>

The condition the test expects to be false.

message
Assert.AssertIsFalseInterpolatedStringHandler

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

conditionExpression
String

The syntactic expression of condition as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Applies to

MSTest.TestFramework 4.0.0
产品 版本
MSTest.TestFramework 4.0.0

IsFalse(Nullable<Boolean>, String)

Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool? condition, string message);
C#
public static void IsFalse(bool? condition, string? message);

Parameters

condition
Nullable<Boolean>

The condition the test expects to be false.

message
String

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

Exceptions

Thrown if condition is true.

Applies to

MSTest.TestFramework 3.11.0 和其他版本
产品 版本
MSTest.TestFramework 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.3, 3.9.3, 3.10.5, 3.11.0

IsFalse(Boolean)

Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool condition);

Parameters

condition
Boolean

The condition the test expects to be false.

Exceptions

Thrown if condition is true.

Applies to

MSTest.TestFramework 3.11.0 和其他版本
产品 版本
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.3, 3.9.3, 3.10.5, 3.11.0

IsFalse(Boolean, String)

Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool condition, string message);
C#
public static void IsFalse(bool condition, string? message);

Parameters

condition
Boolean

The condition the test expects to be false.

message
String

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

Exceptions

Thrown if condition is true.

Applies to

MSTest.TestFramework 3.11.0 和其他版本
产品 版本
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.3, 3.9.3, 3.10.5, 3.11.0

IsFalse(Boolean, Assert+AssertIsFalseInterpolatedStringHandler)

Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool condition, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsFalseInterpolatedStringHandler message);

Parameters

condition
Boolean

The condition the test expects to be false.

message
Assert.AssertIsFalseInterpolatedStringHandler

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

Applies to

MSTest.TestFramework 3.11.0 和其他版本
产品 版本
MSTest.TestFramework 3.8.3, 3.9.3, 3.10.5, 3.11.0

IsFalse(Nullable<Boolean>)

Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool? condition);

Parameters

condition
Nullable<Boolean>

The condition the test expects to be false.

Exceptions

Thrown if condition is true.

Applies to

MSTest.TestFramework 3.11.0 和其他版本
产品 版本
MSTest.TestFramework 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.3, 3.9.3, 3.10.5, 3.11.0

IsFalse(Nullable<Boolean>, Assert+AssertIsFalseInterpolatedStringHandler)

Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs
Source:
Assert.IsTrue.cs

Tests whether the specified condition is false and throws an exception if the condition is true.

C#
public static void IsFalse(bool? condition, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsFalseInterpolatedStringHandler message);

Parameters

condition
Nullable<Boolean>

The condition the test expects to be false.

message
Assert.AssertIsFalseInterpolatedStringHandler

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

Applies to

MSTest.TestFramework 3.11.0 和其他版本
产品 版本
MSTest.TestFramework 3.8.3, 3.9.3, 3.10.5, 3.11.0