AppUtils { public static String getVersion() { return String.format(Locale.US, "%s (#%d)", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE); } private  AppUtils(); static String getVersion(); static boolean hasGooglePlayServices(Context context); static boolean wasInstalledFromGooglePlay(Context context); static boolean isGeolocAllowed(Context context);  }
@Test public void should_format_into_readable_version_name_and_code() { String expected = BuildConfig.VERSION_NAME + " (#" + BuildConfig.VERSION_CODE + ")"; String version = AppUtils.getVersion(); assertThat(version).isEqualTo(expected); }