다음을 통해 공유


StringAssert.Matches 메서드 (String, Regex)

지정한 문자열이 정규식과 일치하는지 여부를 확인합니다.

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

구문

‘선언
Public Shared Sub Matches ( _
    value As String, _
    pattern As Regex _
)
public static void Matches(
    string value,
    Regex pattern
)
public:
static void Matches(
    String^ value, 
    Regex^ pattern
)
static member Matches : 
        value:string * 
        pattern:Regex -> unit 
public static function Matches(
    value : String, 
    pattern : Regex
)

매개 변수

  • value
    형식: System.String
    pattern과 일치해야 할 문자열입니다.

예외

예외 상황
AssertFailedException

value가 pattern과 일치하지 않는 경우

설명

문자열이 식과 일치하지 않으면 어설션이 실패합니다.

.NET Framework 보안

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

참고 항목

참조

StringAssert 클래스

Matches 오버로드

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