@PrepareForTest({ PreferenceManager.class }) @Test public void testInitUnit() throws Exception { }
public static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName){ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); int decimal = preferences.getInt(Application.DECIMAL,4); int unit = isFirstAmount ? Integer.parseInt(preferences.getString(Application.UNIT, String.valueOf(Application.UNIT_DU))): Integer.parseInt(preferences.getString(Application.UNIT_DEFAULT, String.valueOf(Application.UNIT_CLASSIC))); quantitatif = Format.convertBase(quantitatif,base,baseDividend); switch (unit){ case Application.UNIT_CLASSIC: textView.setText(Formater.quantitatifFormatter(quantitatif,currencyName)); break; case Application.UNIT_DU: double amount = UnitCurrency.quantitatif_relatif(quantitatif,base,dividend,baseDividend); textView.setText(Formater.relatifFormatter(context,decimal,amount)); break; case Application.UNIT_TIME: long time = UnitCurrency.quantitatif_time(quantitatif,base,dividend,baseDividend, delay); textView.setText(Formater.timeFormatterV2(context,time)); break; } }
Format { public static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName){ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); int decimal = preferences.getInt(Application.DECIMAL,4); int unit = isFirstAmount ? Integer.parseInt(preferences.getString(Application.UNIT, String.valueOf(Application.UNIT_DU))): Integer.parseInt(preferences.getString(Application.UNIT_DEFAULT, String.valueOf(Application.UNIT_CLASSIC))); quantitatif = Format.convertBase(quantitatif,base,baseDividend); switch (unit){ case Application.UNIT_CLASSIC: textView.setText(Formater.quantitatifFormatter(quantitatif,currencyName)); break; case Application.UNIT_DU: double amount = UnitCurrency.quantitatif_relatif(quantitatif,base,dividend,baseDividend); textView.setText(Formater.relatifFormatter(context,decimal,amount)); break; case Application.UNIT_TIME: long time = UnitCurrency.quantitatif_time(quantitatif,base,dividend,baseDividend, delay); textView.setText(Formater.timeFormatterV2(context,time)); break; } } }
Format { public static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName){ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); int decimal = preferences.getInt(Application.DECIMAL,4); int unit = isFirstAmount ? Integer.parseInt(preferences.getString(Application.UNIT, String.valueOf(Application.UNIT_DU))): Integer.parseInt(preferences.getString(Application.UNIT_DEFAULT, String.valueOf(Application.UNIT_CLASSIC))); quantitatif = Format.convertBase(quantitatif,base,baseDividend); switch (unit){ case Application.UNIT_CLASSIC: textView.setText(Formater.quantitatifFormatter(quantitatif,currencyName)); break; case Application.UNIT_DU: double amount = UnitCurrency.quantitatif_relatif(quantitatif,base,dividend,baseDividend); textView.setText(Formater.relatifFormatter(context,decimal,amount)); break; case Application.UNIT_TIME: long time = UnitCurrency.quantitatif_time(quantitatif,base,dividend,baseDividend, delay); textView.setText(Formater.timeFormatterV2(context,time)); break; } }  }
Format { public static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName){ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); int decimal = preferences.getInt(Application.DECIMAL,4); int unit = isFirstAmount ? Integer.parseInt(preferences.getString(Application.UNIT, String.valueOf(Application.UNIT_DU))): Integer.parseInt(preferences.getString(Application.UNIT_DEFAULT, String.valueOf(Application.UNIT_CLASSIC))); quantitatif = Format.convertBase(quantitatif,base,baseDividend); switch (unit){ case Application.UNIT_CLASSIC: textView.setText(Formater.quantitatifFormatter(quantitatif,currencyName)); break; case Application.UNIT_DU: double amount = UnitCurrency.quantitatif_relatif(quantitatif,base,dividend,baseDividend); textView.setText(Formater.relatifFormatter(context,decimal,amount)); break; case Application.UNIT_TIME: long time = UnitCurrency.quantitatif_time(quantitatif,base,dividend,baseDividend, delay); textView.setText(Formater.timeFormatterV2(context,time)); break; } }  static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName); static long convertBase(long value, int base, int newBase); static String minifyPubkey(String pubkey); static String createUri(boolean simple, String uid, String publicKey, String currency); static Map<String, String> parseUri(String uri); static String isNull(String txt); }
Format { public static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName){ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); int decimal = preferences.getInt(Application.DECIMAL,4); int unit = isFirstAmount ? Integer.parseInt(preferences.getString(Application.UNIT, String.valueOf(Application.UNIT_DU))): Integer.parseInt(preferences.getString(Application.UNIT_DEFAULT, String.valueOf(Application.UNIT_CLASSIC))); quantitatif = Format.convertBase(quantitatif,base,baseDividend); switch (unit){ case Application.UNIT_CLASSIC: textView.setText(Formater.quantitatifFormatter(quantitatif,currencyName)); break; case Application.UNIT_DU: double amount = UnitCurrency.quantitatif_relatif(quantitatif,base,dividend,baseDividend); textView.setText(Formater.relatifFormatter(context,decimal,amount)); break; case Application.UNIT_TIME: long time = UnitCurrency.quantitatif_time(quantitatif,base,dividend,baseDividend, delay); textView.setText(Formater.timeFormatterV2(context,time)); break; } }  static void initUnit(Context context, TextView textView, long quantitatif, int base, long delay, long dividend, int baseDividend, boolean isFirstAmount, String currencyName); static long convertBase(long value, int base, int newBase); static String minifyPubkey(String pubkey); static String createUri(boolean simple, String uid, String publicKey, String currency); static Map<String, String> parseUri(String uri); static String isNull(String txt); static final boolean SIMPLE; static final boolean LONG; }