다음을 통해 공유


TestContext.AspNetDevelopmentServerPrefix 필드

ASP.NET Development Server의 접두사를 나타냅니다.

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

구문

‘선언
Public Const AspNetDevelopmentServerPrefix As String
public const string AspNetDevelopmentServerPrefix
public:
literal String^ AspNetDevelopmentServerPrefix
static val mutable AspNetDevelopmentServerPrefix: string
public const var AspNetDevelopmentServerPrefix : String

설명

이 상수의 값은 "AspNetDevelopmentServer"입니다.

대부분의 경우 이 문자열을 직접 사용할 필요가 없습니다. TryUrlRedirection 메서드를 사용하여 웹 서비스 호출을 올바른 URL로 디렉션할 수 있기 때문입니다.

테스트에 대한 AspNetDevelopmentServerAttribute를 지정한 결과로 시작되는 ASP.NET Development Server 인스턴스에 대한 URL 접두사를 가져오려면 이 문자열을 사용해야 합니다. 이 문자열과 AspNetDevelopmentServerAttribute에서 지정한 이름을 함께 사용합니다. 자세한 내용은 다음 코드 조각을 참조하십시오.

예제

[TestMethod]
[AspNetDevelopmentServerAttribute("MyServer", @"c:\websites\website1", "/website1")]
public void Test()
{
    Uri uriPrefix = TestContext.Properties[TestContext.AspNetDevelopmentServerPrefix + "MyServer"];
}

.NET Framework 보안

참고 항목

참조

TestContext 클래스

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

기타 리소스

Using the TestContext Class