다음을 통해 공유


Assert.AreNotEqual 메서드 (String, String, Boolean)

지정한 두 문자열이 서로 같지 않은지 확인합니다. 대/소문자 구분 여부는 지정된 옵션에 따릅니다.서로 같으면 어설션이 실패합니다.

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

구문

‘선언
Public Shared Sub AreNotEqual ( _
    notExpected As String, _
    actual As String, _
    ignoreCase As Boolean _
)
public static void AreNotEqual(
    string notExpected,
    string actual,
    bool ignoreCase
)
public:
static void AreNotEqual(
    String^ notExpected, 
    String^ actual, 
    bool ignoreCase
)
static member AreNotEqual : 
        notExpected:string * 
        actual:string * 
        ignoreCase:bool -> unit 
public static function AreNotEqual(
    notExpected : String, 
    actual : String, 
    ignoreCase : boolean
)

매개 변수

  • notExpected
    형식: System.String
    비교할 첫째 문자열입니다.단위 테스트에서 actual과 일치하지 않을 것으로 예상하는 문자열입니다.
  • actual
    형식: System.String
    비교할 둘째 문자열입니다.단위 테스트에서 생성한 문자열입니다.
  • ignoreCase
    형식: System.Boolean
    비교에서 대/소문자를 구분하는지 여부를 나타내는 부울 값입니다. true 는 대/소문자를 구분하지 않는 비교를 나타냅니다.

예외

예외 조건
AssertFailedException

notExpected가 actual와 같은 경우

설명

고정 문화권이 비교에 사용됩니다.

.NET Framework 보안

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

참고 항목

참조

Assert 클래스

AreNotEqual 오버로드

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

기타 리소스

Assert 클래스 사용