PexAssert.ReachEventually Method

Definition

Overloads

ReachEventually()

Specifies that the default location in the program should be reached eventually.

ReachEventually(Int32)

Specifies a location in the program that should be reached eventually.

ReachEventually(String)

Specifies a location in the program that should be reached eventually.

ReachEventually()

Specifies that the default location in the program should be reached eventually.

C++
public:
 static void ReachEventually();

Remarks

Must be used in combination with PexAssertReachEventuallyAttribute.

Applies to

Visual Studio SDK 2019 et Visual Studio SDK 2017
Produit Versions
Visual Studio SDK 2017, 2019

ReachEventually(Int32)

Specifies a location in the program that should be reached eventually.

C++
public:
 static void ReachEventually(int location);

Parameters

location
Int32

An integer that identifies a particular ReachEventually instance.

Remarks

This method identifies a particular goal in the code, and is typically used to identify multiple code branches that should be reached by tests. To use ReachEventually, annotate the method that contains the code branches with PexAssertReachEventuallyAttribute set to the number of goals. Call ReachEventually in each of the branches, with location set to one of the goal numbers. The goals are numbered in sequence, starting with 0.

Applies to

Visual Studio SDK 2019 et Visual Studio SDK 2017
Produit Versions
Visual Studio SDK 2017, 2019

ReachEventually(String)

Specifies a location in the program that should be reached eventually.

C++
public:
 static void ReachEventually(System::String ^ location);

Parameters

location
String

A string that identifies a particular ReachEventually instance.

Remarks

This method identifies a particular goal in the code, and is typically used to identify multiple code branches that should be reached by tests. To use ReachEventually, annotate the method that contains the code branches with PexAssertReachEventuallyAttribute, and define the location string in the attribute. Then call ReachEventually in each of the branches, with location set to one of the attribute's location strings.

Applies to

Visual Studio SDK 2019 et Visual Studio SDK 2017
Produit Versions
Visual Studio SDK 2017, 2019