You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide common way to act on test node state, even though they are not connected by inheritance.
Background and Motivation
The code below extracts test node state property and handles all failed states, these states don't define a common interface that would allow accessing the Explanation and Exception on them. Provide a common way of handling them. Ideally one that replaces TestNodePropertiesCategories.WellKnownTestNodeTestRunOutcomeFailedProperties which is an array of the states mentioned below. To avoid the two of them running out of sync.
TestNodeStateProperty nodeState = nodeUpdateMessage.TestNode.Properties.Single<TestNodeStateProperty>();
switch (nodeState)
{
case FailedTestNodeStateProperty failed:
await WriteExceptionAsync(failed.Explanation, failed.Exception);
break;
case ErrorTestNodeStateProperty error:
await WriteExceptionAsync(error.Explanation, error.Exception);
break;
case CancelledTestNodeStateProperty cancelled:
await WriteExceptionAsync(cancelled.Explanation, cancelled.Exception);
break;
case TimeoutTestNodeStateProperty timeout:
await WriteExceptionAsync(timeout.Explanation, timeout.Exception);
break;
}
Proposed Feature
Alternative Designs
The text was updated successfully, but these errors were encountered:
Summary
Provide common way to act on test node state, even though they are not connected by inheritance.
Background and Motivation
The code below extracts test node state property and handles all failed states, these states don't define a common interface that would allow accessing the Explanation and Exception on them. Provide a common way of handling them. Ideally one that replaces
TestNodePropertiesCategories.WellKnownTestNodeTestRunOutcomeFailedProperties
which is an array of the states mentioned below. To avoid the two of them running out of sync.Proposed Feature
Alternative Designs
The text was updated successfully, but these errors were encountered: