다음을 통해 공유


DataCollectorNotifications 클래스

진단 데이터 어댑터에 대한 이벤트를 발생시키기 위해 사용자 지정 테스트 어댑터에서 사용됩니다.

상속 계층 구조

Object
  Microsoft.VisualStudio.TestTools.Execution.DataCollectorNotifications

네임스페이스:  Microsoft.VisualStudio.TestTools.Execution
어셈블리:  Microsoft.VisualStudio.QualityTools.ExecutionCommon(Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll)

구문

‘선언
Public MustInherit Class DataCollectorNotifications
public abstract class DataCollectorNotifications
public ref class DataCollectorNotifications abstract
[<AbstractClass>]
type DataCollectorNotifications =  class end
public abstract class DataCollectorNotifications

DataCollectorNotifications 형식에서는 다음과 같은 멤버를 노출합니다.

생성자

  이름 설명
Protected 메서드 DataCollectorNotifications DataCollectorNotifications 클래스의 새 인스턴스를 초기화합니다.

위쪽

메서드

  이름 설명
Public 메서드 Equals 지정한 개체와 현재 개체가 같은지를 확인합니다. (Object에서 상속됨)
Protected 메서드 Finalize 가비지 수집기가 회수하기 전에 개체가 리소스를 해제하고 다른 정리 작업을 수행할 수 있게 합니다. (Object에서 상속됨)
Public 메서드 GetHashCode 기본 해시 함수로 작동합니다. (Object에서 상속됨)
Public 메서드 GetType 현재 인스턴스의 Type을 가져옵니다. (Object에서 상속됨)
Protected 메서드 MemberwiseClone 현재 Object의 부분 복사본을 만듭니다. (Object에서 상속됨)
Public 메서드 RaiseCustomEvent(CustomNotificationEventArgs) 제공된 이벤트 인수를 사용하여 사용자 지정 이벤트를 발생시킵니다.
Public 메서드 RaiseCustomEvent(CustomNotificationEventArgs, NotificationBroadcastLevel) 제공된 이벤트 인수와 표시된 브로드캐스트 수준을 사용하여 사용자 지정 이벤트를 발생시킵니다.
Public 메서드 RaiseCustomEventAsync(CustomNotificationEventArgs) 제공된 이벤트 인수를 사용하여 사용자 지정 이벤트를 비동기적으로 발생시킵니다.
Public 메서드 RaiseCustomEventAsync(CustomNotificationEventArgs, NotificationBroadcastLevel) 제공된 이벤트 인수와 표시된 브로드캐스트 수준을 사용하여 사용자 지정 이벤트를 비동기적으로 발생시킵니다.
Public 메서드 RaiseCustomEventAsync(CustomNotificationEventArgs, NotificationBroadcastLevel, Object) 제공된 이벤트 인수, 표시된 브로드캐스트 수준 및 사용자 토큰을 사용하여 사용자 지정 이벤트를 비동기적으로 발생시킵니다.
Public 메서드 RaiseTestFailedEvent 진단 데이터 어댑터에 테스트 사례가 실패했음을 알리는 TestCaseFailed 이벤트를 발생시킵니다.
Public 메서드 ToString 현재 개체를 나타내는 문자열을 반환합니다. (Object에서 상속됨)

위쪽

이벤트

  이름 설명
Public 이벤트 CustomEventCompleted 진단 데이터 어댑터가 비동기 이벤트 처리를 마칠 때 테스트 프레임워크에 의해 발생됩니다.

위쪽

예제

사용자 지정 테스트 어댑터 클래스에서 DataCollectorNotifications 개체를 사용하려면 먼저 IDataCollectionAwareTestAdapter를 파생된 테스트 어댑터에 대한 클래스 선언에 추가합니다.

public class MyTestAdapter : ITestAdapter, IDataCollectionAwareTestAdapter

그런 다음 테스트 어댑터 코드에서 DataCollectorNotifications 개체를 반환하는 DataCollectors 속성을 만듭니다.

public DataCollectorNotifications DataCollectors { get; set; }

그런 다음 이 개체를 사용하여 진단 데이터 어댑터에 대한 이벤트를 발생시킬 수 있습니다.

DataCollectors.RaiseCustomEvent(
    new MyCustomDataEventArgs(), 
    NotificationBroadCastLevel.All);

스레드로부터의 안전성

이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

참고 항목

참조

Microsoft.VisualStudio.TestTools.Execution 네임스페이스

DataCollectors

ITestAdapter

DataCollector

DataCollectorNotifications

기타 리소스

진단 데이터 어댑터를 만들어 사용자 지정 데이터를 수집하거나 테스트 컴퓨터에 영향 주기