【问题标题】:show assertion message with robolectric使用 robolectric 显示断言消息
【发布时间】:2013-05-31 01:52:20
【问题描述】:

我正在使用 maven 和 robolectric 来测试我的 android 应用程序,我希望看到我在断言失败时放入的注释。我似乎在任何地方都找不到这些。它们不会出现在控制台中,也不会输出到 surefire-reports 目录中。

例如,当此断言失败时,我希望在某处看到“失败,因为 X 和 Y 不相等”。

Boolean X = true;
Boolean Y = false;

assertEquals("Failed because X and Y are not equal",X,Y); 

【问题讨论】:

    标签: android maven robolectric android-testing


    【解决方案1】:

    你可以使用 Assert.assertTrue(x);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-26
      • 2012-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多