Assert.IsFalse Method

Definition

Overloads

IsFalse(Boolean, String)

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(Boolean, String, Object[])

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, 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(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(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

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.8.0 et autres versions
Produit Versions
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.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

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.8.0 et autres versions
Produit Versions
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.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

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.8.0 et autres versions
Produit Versions
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.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

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.8.0 et autres versions
Produit Versions
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.0

IsFalse(Boolean, Assert+AssertIsFalseInterpolatedStringHandler)

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
Microsoft.VisualStudio.TestTools.UnitTesting.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.8.0
Produit Versions
MSTest.TestFramework 3.8.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

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.8.0 et autres versions
Produit Versions
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.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

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.8.0 et autres versions
Produit Versions
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.0

IsFalse(Nullable<Boolean>, Assert+AssertIsFalseInterpolatedStringHandler)

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
Microsoft.VisualStudio.TestTools.UnitTesting.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.8.0
Produit Versions
MSTest.TestFramework 3.8.0