matlab.unittest.constraints.IsFalse 클래스
네임스페이스: matlab.unittest.constraints
슈퍼클래스: matlab.unittest.constraints.Constraint
값이 false인지 테스트
설명
matlab.unittest.constraints.IsFalse
클래스는 값이 false인지 테스트하는 제약 조건을 제공합니다.
생성
설명
c = matlab.unittest.constraints.IsFalse
는 값이 false인지 테스트하는 제약 조건을 만듭니다. 이 제약 조건은 논리형 스칼라 값이 0
(false
)인 경우 충족됩니다.
예제
값이 false인지 테스트하기
IsFalse
제약 조건을 사용하여 값을 테스트합니다.
먼저 이 예제에서 사용되는 클래스를 가져옵니다.
import matlab.unittest.TestCase import matlab.unittest.constraints.IsFalse
대화형 방식 테스트를 위한 테스트 케이스를 생성합니다.
testCase = TestCase.forInteractiveUse;
false
가 IsFalse
제약 조건을 충족하는지 확인합니다.
testCase.verifyThat(false,IsFalse)
Verification passed.
true
가 제약 조건을 충족하는지 테스트합니다. 테스트가 실패합니다.
testCase.verifyThat(true,IsFalse)
Verification failed. --------------------- Framework Diagnostic: --------------------- IsFalse failed. --> The value must evaluate to "false". Actual Value: logical 1
값 0
을 테스트합니다. 값이 double
형이므로 테스트가 실패합니다.
testCase.verifyThat(0,IsFalse)
Verification failed. --------------------- Framework Diagnostic: --------------------- IsFalse failed. --> The value must be logical. It is of type "double". Actual Value: 0
값 [false false]
를 테스트합니다. 값이 비 스칼라이므로 테스트가 실패합니다.
testCase.verifyThat([false false],IsFalse)
Verification failed. --------------------- Framework Diagnostic: --------------------- IsFalse failed. --> The value must be scalar. It has a size of [1 2]. Actual Value: 1×2 logical array 0 0
버전 내역
R2013a에 개발됨
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)