【问题标题】:Hamcrest's greaterThan and lessThan doesn't compile in junit:junit:4.12Hamcrest 的大于和小于在 junit:junit:4.12 中不编译
【发布时间】:2017-10-28 05:59:41
【问题描述】:

我无法通过 junit:junit:4.12 在我的应用程序的测试部分编译大于和小于

我的代码是:

 List<String> list = someListProducingMethod();
 assertThat("test",  containsString("estr"));
 assertThat(list, allOf(hasSize(greaterThan(3)), hasSize(lessThan(12))));

【问题讨论】:

    标签: android unit-testing hamcrest


    【解决方案1】:

    只需将此行添加到 gradle

    testCompile 'org.hamcrest:hamcrest-library:1.3'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-17
      相关资源
      最近更新 更多