WebServiceHelper.TryUrlRedirection 메서드

웹 서비스 개체를 제공된 웹 참조에서 정의되는 리소스 대신 ASP.NET 개발 서버로 리디렉션합니다.

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

구문

‘선언
Public Shared Function TryUrlRedirection ( _
    client As WebClientProtocol, _
    context As TestContext, _
    identifier As String _
) As Boolean
public static bool TryUrlRedirection(
    WebClientProtocol client,
    TestContext context,
    string identifier
)
public:
static bool TryUrlRedirection(
    WebClientProtocol^ client, 
    TestContext^ context, 
    String^ identifier
)
static member TryUrlRedirection : 
        client:WebClientProtocol * 
        context:TestContext * 
        identifier:string -> bool 
public static function TryUrlRedirection(
    client : WebClientProtocol, 
    context : TestContext, 
    identifier : String
) : boolean

매개 변수

  • identifier
    형식: System.String
    ASP.NET Development Server 인스턴스를 식별하는 고유한 문자열입니다.이 문자열은 테스트 메서드에 대한 AspNetDevelopmentServerAttribute의 이름 매개 변수와 일치합니다.

반환 값

형식: System.Boolean
리디렉션이 발생하면 true이고, 그렇지 않으면 false입니다.

설명

AspNetDevelopmentServerAttribute를 사용하여 테스트를 실행하면 ASP.NET Development Server의 인스턴스가 시작됩니다. 이렇게 하면 ASP.NET Development Server 사이트가 시작되고 URL을 알 수 있게 됩니다. 테스트를 실행할 때 TryUrlRedirection을 사용하여 웹 서비스 개체를 리디렉션하여 제공된 웹 참조에 정의된 리소스 대신 알려진 서버를 가리키도록 할 수 있습니다. 이 메서드는 리디렉션에 성공할 경우 false를 반환하고 그렇지 않으면 true를 반환합니다. 예를 들어, 식별자가 기존 ASP.NET Development Server 인스턴스의 이름과 일치하지 않는 경우 메서드는 false를 반환합니다.

.NET Framework 보안

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

참고 항목

참조

WebServiceHelper 클래스

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

TestContext

AspNetDevelopmentServerAttribut