本文整理匯總了Java中com.google.common.truth.Truth.assertThat方法的典型用法代碼示例。如果您正苦於以下問題:Java Truth.assertThat方法的具體用法?Java Truth.assertThat怎麽用?Java Truth.assertThat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.truth.Truth
的用法示例。
在下文中一共展示了Truth.assertThat方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: viewStateForClassView_throw
import com.google.common.truth.Truth; //導入方法依賴的package包/類
@Test
public void viewStateForClassView_throw() {
try {
getThat(JavaFileObjects.forResource("view/CounterTestView.java"), JavaFileObjects.forResource("presenter/InjectViewStateForClassPresenter.java")).failsToCompile();
fail();
} catch (RuntimeException e) {
Truth.assertThat(e.getLocalizedMessage().contains("must be INTERFACE, or not mark it as"));
}
}
示例2: standardError
import com.google.common.truth.Truth; //導入方法依賴的package包/類
public StringSubject standardError() {
return Truth.assertThat(actual().error);
}
示例3: standardOutput
import com.google.common.truth.Truth; //導入方法依賴的package包/類
public StringSubject standardOutput() {
return Truth.assertThat(actual().output);
}
示例4: exitCode
import com.google.common.truth.Truth; //導入方法依賴的package包/類
public IntegerSubject exitCode() {
return Truth.assertThat(actual().exitCode);
}
示例5: assertException
import com.google.common.truth.Truth; //導入方法依賴的package包/類
private static ThrowableSubject assertException(
Class<? extends Throwable> exceptionType, Executable executable) {
Throwable exception = Assertions.assertThrows(exceptionType, executable);
return Truth.assertThat(exception);
}
示例6: assertThat
import com.google.common.truth.Truth; //導入方法依賴的package包/類
private static IterableSubject assertThat(DoubleStream stream) {
return Truth.assertThat(Doubles.asList(stream.toArray()));
}
示例7: assertThat
import com.google.common.truth.Truth; //導入方法依賴的package包/類
@NonNull
public static IterableSubject assertThat(@NonNull final DoubleStream stream) {
return Truth.assertThat(Doubles.asList(stream.toArray()));
}