androidfest

Android Test - With FEST - isEquals result


I would like to know how would be the implementation to compare 2 equal results (int).

I looked for FEST documentation, but I just could find a few tutorials.

When implementing with assertThat, I cannot find the right implementation to compare same values.


Solution

  • I also not found any equals method which compare two int parameters. But I think there aren't designed Fest API to compare primitives. So, you can use simple JUnit API for compare primitives. Meanwhile I found this example:

    FEST Android:

    assertThat(view).isGone();
    

    Regular JUnit:

    assertEquals(View.GONE, view.getVisibility());
    

    Please check this documentation. The ANDROID class containt many asserThan methods to compare android objects.