다음을 통해 공유


Assert.AreNotEqual 메서드 (String, String, Boolean, CultureInfo, String, array<Object )

지정한 두 문자열이 서로 같지 않은지 확인합니다. 대/소문자 구분 여부 및 사용할 문화권은 지정된 옵션에 따릅니다.서로 같으면 어설션이 실패합니다.어설션이 실패할 경우 지정된 서식이 적용된 메시지를 표시합니다.

네임스페이스:  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, _
    culture As CultureInfo, _
    message As String, _
    ParamArray parameters As Object() _
)
public static void AreNotEqual(
    string notExpected,
    string actual,
    bool ignoreCase,
    CultureInfo culture,
    string message,
    params Object[] parameters
)
public:
static void AreNotEqual(
    String^ notExpected, 
    String^ actual, 
    bool ignoreCase, 
    CultureInfo^ culture, 
    String^ message, 
    ... array<Object^>^ parameters
)
static member AreNotEqual : 
        notExpected:string * 
        actual:string * 
        ignoreCase:bool * 
        culture:CultureInfo * 
        message:string * 
        parameters:Object[] -> unit 
public static function AreNotEqual(
    notExpected : String, 
    actual : String, 
    ignoreCase : boolean, 
    culture : CultureInfo, 
    message : String, 
    ... parameters : Object[]
)

매개 변수

  • notExpected
    형식: System.String
    비교할 첫째 문자열입니다.단위 테스트에서 actual과 일치하지 않을 것으로 예상하는 문자열입니다.
  • actual
    형식: System.String
    비교할 둘째 문자열입니다.단위 테스트에서 생성한 문자열입니다.
  • ignoreCase
    형식: System.Boolean
    비교에서 대/소문자를 구분하는지 여부를 나타내는 부울 값입니다. true 는 대/소문자를 구분하지 않는 비교를 나타냅니다.
  • message
    형식: System.String
    어설션이 실패할 경우 표시되는 메시지입니다.이 메시지는 단위 테스트 결과에 표시됩니다.
  • parameters
    형식: array<System.Object[]
    message의 서식을 지정할 때 사용할 매개 변수의 배열입니다.

예외

예외 조건
AssertFailedException

notExpected가 actual와 같은 경우

.NET Framework 보안

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

참고 항목

참조

Assert 클래스

AreNotEqual 오버로드

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

기타 리소스

Assert 클래스 사용