本文整理汇总了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()));
}