Contract.Assume Method (Boolean)

 

Instructs code analysis tools to assume that the specified condition is true, even if it cannot be statically proven to always be true.

Namespace:   System.Diagnostics.Contracts
Assembly:  mscorlib (in mscorlib.dll)

[ConditionalAttribute("DEBUG")]
[ConditionalAttribute("CONTRACTS_FULL")]
public static void Assume(
	bool condition
)

Parameters

condition
Type: System.Boolean

The conditional expression to assume true.

At run time, using this method is equivalent to using the Assert(Boolean) method.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show: