다음을 통해 공유


HostTypeAttribute 생성자 (String)

HostTypeAttribute 클래스의 새 인스턴스를 초기화합니다.이는 이 단위 테스트를 실행하는 호스트의 형식을 지정하는 인수를 사용하여 인스턴스화됩니다.

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

구문

‘선언
Public Sub New ( _
    hostType As String _
)
public HostTypeAttribute(
    string hostType
)
public:
HostTypeAttribute(
    String^ hostType
)
new : 
        hostType:string -> HostTypeAttribute
public function HostTypeAttribute(
    hostType : String
)

매개 변수

  • hostType
    형식: System.String
    이 단위 테스트를 실행할 호스트의 형식입니다.

설명

Visual Studio 2005에 포함되어 있는 호스트의 표준 형식은 ASP.NET입니다.

예제

[TestMethod()]
[HostType("ASP.NET")]
[UrlToTest("https://localhost:1371/webSite12")]
[AspNetDevelopmentServerHost("d:\\MyWebSite", "/MyWebSiteRoot")]
public void ConstructorTest()
{
   object target = TestProject1.Class1Accessor.CreatePrivate();
   Assert.Inconclusive("TODO: Implement code to verify target");
}

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

HostTypeAttribute 클래스

HostTypeAttribute 오버로드

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