Skip to content

Commit

Permalink
Migrate to AssertJ
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Aug 18, 2024
1 parent b4f1813 commit 2b0e1a7
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 213 deletions.
188 changes: 94 additions & 94 deletions src/test/java/org/joda/money/TestBigMoney.java

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions src/test/java/org/joda/money/TestCurrencyUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ void test_registeredCurrencies_crossCheck() {
@Test
void test_registeredCountries() {
List<String> countryList = CurrencyUnit.registeredCountries();
assertThat(countryList.contains("GB")).isTrue();
assertThat(countryList.contains("EU")).isTrue();
assertThat(countryList.contains("US")).isTrue();
assertThat(countryList).contains("GB");
assertThat(countryList).contains("EU");
assertThat(countryList).contains("US");
}

@Test
Expand Down Expand Up @@ -513,7 +513,7 @@ void test_getNumeric3Code_AMD() {
@Test
void test_getNumeric3Code_XFU() {
CurrencyUnit test = CurrencyUnit.of("XFU");
assertThat(test.getNumeric3Code()).isEqualTo("");
assertThat(test.getNumeric3Code()).isEmpty();
}

//-----------------------------------------------------------------------
Expand All @@ -531,10 +531,10 @@ void test_getNumericCode_GBP() {
@Test
void test_getCurrencyCodes_GBP() {
Set<String> test = CurrencyUnit.of("GBP").getCountryCodes();
assertThat(test.contains("GB")).isTrue();
assertThat(test.contains("IM")).isTrue();
assertThat(test.contains("JE")).isTrue();
assertThat(test.contains("GG")).isTrue();
assertThat(test).contains("GB");
assertThat(test).contains("IM");
assertThat(test).contains("JE");
assertThat(test).contains("GG");
}

//-----------------------------------------------------------------------
Expand Down Expand Up @@ -600,7 +600,7 @@ void test_getSymbol_JPY() {
try {
Locale.setDefault(Locale.UK);
CurrencyUnit test = CurrencyUnit.of("JPY");
assertThat(test.getSymbol().contains("JP")).isTrue();
assertThat(test.getSymbol()).contains("JP");
} finally {
Locale.setDefault(loc);
}
Expand Down Expand Up @@ -651,7 +651,7 @@ void test_getSymbol_Locale_GBP_France() {
try {
Locale.setDefault(Locale.UK);
CurrencyUnit test = CurrencyUnit.of("GBP");
assertThat(test.getSymbol(Locale.FRANCE).contains("GB")).isTrue();
assertThat(test.getSymbol(Locale.FRANCE)).contains("GB");
} finally {
Locale.setDefault(loc);
}
Expand All @@ -675,7 +675,7 @@ void test_getSymbol_Locale_USD_France() {
try {
Locale.setDefault(Locale.UK);
CurrencyUnit test = CurrencyUnit.of("USD");
assertThat(test.getSymbol(Locale.FRANCE).contains("US")).isTrue();
assertThat(test.getSymbol(Locale.FRANCE)).contains("US");
} finally {
Locale.setDefault(loc);
}
Expand Down Expand Up @@ -789,7 +789,7 @@ void test_equals_false() {
@Test
void test_toString() {
CurrencyUnit test = CurrencyUnit.of("GBP");
assertThat(test.toString()).isEqualTo("GBP");
assertThat(test).hasToString("GBP");
}

}
4 changes: 2 additions & 2 deletions src/test/java/org/joda/money/TestCurrencyUnitExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ void test_CurrencyMissing() {
void test_CurrencyEURChanged() {
CurrencyUnit currency = CurrencyUnit.ofCountry("HU");
assertThat(currency).isEqualTo(CurrencyUnit.EUR);
assertThat(CurrencyUnit.EUR.getCountryCodes().contains("HU")).isTrue();
assertThat(CurrencyUnit.of("HUF").getCountryCodes().isEmpty()).isTrue();
assertThat(CurrencyUnit.EUR.getCountryCodes()).contains("HU");
assertThat(CurrencyUnit.of("HUF").getCountryCodes()).isEmpty();
}

}
Loading

0 comments on commit 2b0e1a7

Please sign in to comment.