DataCollectorNotifications Class
Used by custom test adapters to raise events for diagnostic data adapters.
Inheritance Hierarchy
Object
Microsoft.VisualStudio.TestTools.Execution.DataCollectorNotifications
Namespace: Microsoft.VisualStudio.TestTools.Execution
Assembly: Microsoft.VisualStudio.QualityTools.ExecutionCommon (in Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll)
Syntax
'Declaration
Public MustInherit Class DataCollectorNotifications
public abstract class DataCollectorNotifications
public ref class DataCollectorNotifications abstract
[<AbstractClass>]
type DataCollectorNotifications = class end
public abstract class DataCollectorNotifications
The DataCollectorNotifications type exposes the following members.
Constructors
Name | Description | |
---|---|---|
DataCollectorNotifications | Initializes a new instance of the DataCollectorNotifications class. |
Top
Methods
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
RaiseCustomEvent(CustomNotificationEventArgs) | Raises a custom event by using the provided event arguments. | |
RaiseCustomEvent(CustomNotificationEventArgs, NotificationBroadcastLevel) | Raises a custom event by using the provided event arguments and indication of broadcast level. | |
RaiseCustomEventAsync(CustomNotificationEventArgs) | Asynchronously raises a custom event by using the provided event arguments. | |
RaiseCustomEventAsync(CustomNotificationEventArgs, NotificationBroadcastLevel) | Asynchronously raises a custom event by using the provided event arguments and indication of broadcast level. | |
RaiseCustomEventAsync(CustomNotificationEventArgs, NotificationBroadcastLevel, Object) | Asynchronously raises a custom event by using the provided event arguments, indication of broadcast level, and user token. | |
RaiseTestFailedEvent | Raises a TestCaseFailed event to notify diagnostic data adapters that the test case has failed. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Events
Name | Description | |
---|---|---|
CustomEventCompleted | Raised by the testing framework when a diagnostic data adapter has finished handling an asynchronous event. |
Top
Examples
To use a DataCollectorNotifications object in a custom test adapter class, you first add the IDataCollectionAwareTestAdapter to the class declaration for your derived test adapter.
public class MyTestAdapter : ITestAdapter, IDataCollectionAwareTestAdapter
Then in your test adapter code, you create a DataCollectors property that returns a DataCollectorNotifications object.
public DataCollectorNotifications DataCollectors { get; set; }
You can then use this object to raise events for diagnostic data adapters.
DataCollectors.RaiseCustomEvent(
new MyCustomDataEventArgs(),
NotificationBroadCastLevel.All);
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.VisualStudio.TestTools.Execution Namespace
DataCollectorNotifications
Other Resources
Creating a Diagnostic Data Adapter to Collect Custom Data or Affect a Test Machine