TestResult describes all the result data that is returned when a test runs. This class includes basic information such as whether a test passed or failed.
Note: |
|---|
Because TestResult objects can be passed to different processes and other computers, they cannot rely on any
Visual Studio components and must be serializable.
|
To implement the TestResult class
If you want your test to report additional result data, create a subclass of the TestResult class. In your subclass, include additional properties for storing that additional data:
public TestResult()
The following code is needed for serialization:
public object Clone();
Note: |
|---|
ITip tells
Team System how to save TestElements to disk and load TestElements from disk. Because you define the way test items are loaded and saved, you are free to specify any file format you want, as long as the contents of the test file describe each test sufficiently. You can decide how many tests each test file will contain. A test file can contain one or more tests.
|
The following returns the associated test type identifier:
public TestType { get; }
The following line loads a collection of test items from the specified file location. The newly created test items should keep a reference to projectData, and the warningHandler should be used to output warnings to the UI if loading fails.
ICollection Load( string Location, ProjectData projectData, IWarningHandler warningHandler )
Save an array of test elements to the specified file location:
void Save( ITestElement[] rgTests, string Location, ProjectData projectData )