다음을 통해 공유


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

지정한 두 single이 서로 같지 않거나 지정된 정확도 범위 내에 있지 않은지 확인합니다. 서로 같거나 지정된 정확도 범위 내에 있으면 어설션이 실패합니다. 어설션이 실패할 경우 메시지를 표시합니다.

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

구문

‘선언
Public Shared Sub AreNotEqual ( _
    notExpected As Single, _
    actual As Single, _
    delta As Single, _
    message As String _
)
public static void AreNotEqual(
    float notExpected,
    float actual,
    float delta,
    string message
)
public:
static void AreNotEqual(
    float notExpected, 
    float actual, 
    float delta, 
    String^ message
)
static member AreNotEqual : 
        notExpected:float32 * 
        actual:float32 * 
        delta:float32 * 
        message:string -> unit
public static function AreNotEqual(
    notExpected : float, 
    actual : float, 
    delta : float, 
    message : String
)

매개 변수

  • notExpected
    형식: Single

    비교할 첫 번째 single입니다. 단위 테스트에서 예상하는 single입니다.

  • actual
    형식: Single

    비교할 두 번째 single입니다. 단위 테스트에서 생성한 single입니다.

  • delta
    형식: Single

    요구되는 오차입니다. notExpected가 actual과 같거나 두 값의 차이가 delta 미만인 경우에만 어설션이 실패합니다.

  • message
    형식: String

    어설션이 실패할 경우 표시되는 메시지입니다. 이 메시지는 단위 테스트 결과에 표시됩니다.

예외

예외 조건
AssertFailedException

notExpected가 actual과 같거나 두 값의 차이가 delta 미만인 경우

.NET Framework 보안

참고 항목

참조

Assert 클래스

AreNotEqual 오버로드

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

기타 리소스

Assert 클래스 사용