question stringlengths 935 50.2k | answer stringlengths 92 8.26k |
|---|---|
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseBigMoney_CharSequence_invalidCurrency() {
iParseTest.parseBigMoney("12.34 GBX");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseBigMoney_CharSequence_notFullyParsed() {
iParseTest.parseBigMoney("12.34 GBP X");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseBigMoney_CharSequence_incomplete() {
iParseTest.parseBigMoney("12.34 GBP ");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseBigMoney_CharSequence_incompleteLongText() {
iParseTest.parseBigMoney("12.34 GBP ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseBigMoney_CharSequence_incompleteEmptyParser() {
iCannotPrint.parseBigMoney("12.34 GBP");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseBigMoney_CharSequence_missingCurrency() {
MoneyFormatter f = new MoneyFormatterBuilder().appendAmount().toFormatter();
f.parseBigMoney("12.34");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = UnsupportedOperationException.class)
public void test_parseBigMoney_CharSequence_cannotParse() {
iCannotParse.parseBigMoney(new StringBuilder());
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = NullPointerException.class)
public void test_parseBigMoney_CharSequence_nullCharSequence() {
iParseTest.parseBigMoney((CharSequence) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseMoney' in class 'org.joda.money.format.MoneyFormatter' fo... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseMoney_CharSequence_invalidCurrency() {
iParseTest.parseMoney("12.34 GBX");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseMoney' in class 'org.joda.money.format.MoneyFormatter' fo... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseMoney_CharSequence_notFullyParsed() {
iParseTest.parseMoney("12.34 GBP X");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseMoney' in class 'org.joda.money.format.MoneyFormatter' fo... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseMoney_CharSequence_incomplete() {
iCannotPrint.parseMoney("12.34 GBP");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseMoney' in class 'org.joda.money.format.MoneyFormatter' fo... | ```java
@Test(expected = UnsupportedOperationException.class)
public void test_parseMoney_CharSequence_cannotParse() {
iCannotParse.parseMoney(new StringBuilder());
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseMoney' in class 'org.joda.money.format.MoneyFormatter' fo... | ```java
@Test(expected = NullPointerException.class)
public void test_parseMoney_CharSequence_nullCharSequence() {
iParseTest.parseMoney((CharSequence) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'org.joda.money.format.MoneyFormatter' for the... | ```java
@Test(expected = UnsupportedOperationException.class)
public void test_parse_CharSequenceInt_cannotParse() {
iCannotParse.parse(new StringBuilder(), 0);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'org.joda.money.format.MoneyFormatter' for the... | ```java
@Test(expected = NullPointerException.class)
public void test_parse_CharSequenceInt_nullCharSequence() {
iParseTest.parse((CharSequence) null, 0);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'org.joda.money.format.MoneyFormatter' for the... | ```java
@Test(expected = IndexOutOfBoundsException.class)
public void test_parse_CharSequenceInt_startIndexTooSmall() {
iParseTest.parse("", -1);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'org.joda.money.format.MoneyFormatter' for the... | ```java
@Test(expected = IndexOutOfBoundsException.class)
public void test_parse_CharSequenceInt_startIndexTooBig() {
iParseTest.parse("", 1);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseMoney' in class 'org.joda.money.format.MoneyFormatter' fo... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseMoney_notFullyParsed() {
iParseTest.parseMoney("GBP hello notfullyparsed");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseMoney' in class 'org.joda.money.format.MoneyFormatter' fo... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseMoney_noAmount() {
iParseTest.parseMoney("GBP hello");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseBigMoney_notFullyParsed() {
iParseTest.parseBigMoney("GBP hello notfullyparsed");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parseBigMoney' in class 'org.joda.money.format.MoneyFormatter'... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parseBigMoney_noAmount() {
iParseTest.parseBigMoney("GBP hello");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'toBigMoney' in class 'org.joda.money.format.MoneyParseContext'... | ```java
@Test(expected = MoneyFormatException.class)
public void test_parse_notFullyParsed() {
MoneyParseContext context = iParseTest.parse("GBP hello notfullyparsed", 1);
context.toBigMoney();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'Arithme... | ```java
@Test(expected = ArithmeticException.class)
public void test_factory_of_Currency_BigDecimal_invalidScaleGBP() {
Money.of(GBP, BIGDEC_2_345);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'Arithme... | ```java
@Test(expected = ArithmeticException.class)
public void test_factory_of_Currency_BigDecimal_invalidScaleJPY() {
Money.of(JPY, BIGDEC_2_3);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_of_Currency_BigDecimal_nullCurrency() {
Money.of((CurrencyUnit) null, BIGDEC_2_34);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_of_Currency_BigDecimal_nullBigDecimal() {
Money.of(GBP, (BigDecimal) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'Arithme... | ```java
@Test(expected = ArithmeticException.class)
public void test_factory_of_Currency_BigDecimal_RoundingMode_UNNECESSARY() {
Money.of(JPY, BIGDEC_2_34, RoundingMode.UNNECESSARY);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_of_Currency_BigDecimal_RoundingMode_nullCurrency() {
Money.of((CurrencyUnit) null, BIGDEC_2_34, RoundingMode.DOWN);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_of_Currency_BigDecimal_RoundingMode_nullBigDecimal() {
Money.of(GBP, (BigDecimal) null, RoundingMode.DOWN);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_of_Currency_BigDecimal_RoundingMode_nullRoundingMode() {
Money.of(GBP, BIGDEC_2_34, (RoundingMode) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'Arithme... | ```java
@Test(expected = ArithmeticException.class)
public void test_factory_of_Currency_double_invalidScaleGBP() {
Money.of(GBP, 2.345d);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'Arithme... | ```java
@Test(expected = ArithmeticException.class)
public void test_factory_of_Currency_double_invalidScaleJPY() {
Money.of(JPY, 2.3d);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_of_Currency_double_nullCurrency() {
Money.of((CurrencyUnit) null, BIGDEC_2_34);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'Arithme... | ```java
@Test(expected = ArithmeticException.class)
public void test_factory_of_Currency_double_RoundingMode_UNNECESSARY() {
Money.of(JPY, 2.34d, RoundingMode.UNNECESSARY);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_of_Currency_double_RoundingMode_nullCurrency() {
Money.of((CurrencyUnit) null, 2.34d, RoundingMode.DOWN);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_of_Currency_double_RoundingMode_nullRoundingMode() {
Money.of(GBP, 2.34d, (RoundingMode) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'ofMajor' in class 'org.joda.money.Money' for the exception 'Nu... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_ofMajor_Currency_long_nullCurrency() {
Money.ofMajor((CurrencyUnit) null, 234);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'ofMinor' in class 'org.joda.money.Money' for the exception 'Nu... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_ofMinor_Currency_long_nullCurrency() {
Money.ofMinor((CurrencyUnit) null, 234);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'zero' in class 'org.joda.money.Money' for the exception 'NullP... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_zero_Currency_nullCurrency() {
Money.zero((CurrencyUnit) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'Arithme... | ```java
@Test(expected = ArithmeticException.class)
public void test_factory_from_BigMoneyProvider_invalidCurrencyScale() {
Money.of(BigMoney.parse("GBP 104.235"));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_from_BigMoneyProvider_nullBigMoneyProvider() {
Money.of((BigMoneyProvider) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_from_BigMoneyProvider_RoundingMode_nullBigMoneyProvider() {
Money.of((BigMoneyProvider) null, RoundingMode.DOWN);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'of' in class 'org.joda.money.Money' for the exception 'NullPoi... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_from_BigMoneyProvider_RoundingMode_nullRoundingMode() {
Money.of(BigMoney.parse("GBP 104.235"), (RoundingMode) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Ille... | ```java
@Test(expected = IllegalArgumentException.class)
public void test_factory_total_varargs_empty() {
Money.total();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Ille... | ```java
@Test(expected = IllegalArgumentException.class)
public void test_factory_total_array_empty() {
Money[] array = new Money[0];
Money.total(array);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Curr... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_factory_total_varargs_currenciesDiffer() {
try {
Money.total(GBP_2_33, JPY_423);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstCurrency());
assertEquals(JPY, ex.getSecondCurrency());
... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Curr... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_factory_total_array_currenciesDiffer() {
try {
Money[] array = new Money[] { GBP_2_33, JPY_423 };
Money.total(array);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstCurrency());
asse... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_varargs_nullFirst() {
Money.total((Money) null, GBP_2_33, GBP_2_36);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_array_nullFirst() {
Money[] array = new Money[] { null, GBP_2_33, GBP_2_36 };
Money.total(array);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_varargs_nullNotFirst() {
Money.total(GBP_2_33, null, GBP_2_36);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_array_nullNotFirst() {
Money[] array = new Money[] { GBP_2_33, null, GBP_2_36 };
Money.total(array);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Ille... | ```java
@Test(expected = IllegalArgumentException.class)
public void test_factory_total_Iterable_empty() {
Iterable<Money> iterable = Collections.emptyList();
Money.total(iterable);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Curr... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_factory_total_Iterable_currenciesDiffer() {
try {
Iterable<Money> iterable = Arrays.asList(GBP_2_33, JPY_423);
Money.total(iterable);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstCurrency(... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_Iterable_nullFirst() {
Iterable<Money> iterable = Arrays.asList(null, GBP_2_33, GBP_2_36);
Money.total(iterable);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_Iterable_nullNotFirst() {
Iterable<Money> iterable = Arrays.asList(GBP_2_33, null, GBP_2_36);
Money.total(iterable);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Curr... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_factory_total_CurrencyUnitVarargs_currenciesDiffer() {
try {
Money.total(GBP, JPY_423);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstCurrency());
assertEquals(JPY, ex.getSecondCurrency());... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Curr... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_factory_total_CurrencyUnitArray_currenciesDiffer() {
try {
Money[] array = new Money[] { JPY_423 };
Money.total(GBP, array);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstCurrency());
... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Curr... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_factory_total_CurrencyUnitVarargs_currenciesDifferInArray() {
try {
Money.total(GBP, GBP_2_33, JPY_423);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstCurrency());
assertEquals(JPY, ex.getS... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Curr... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_factory_total_CurrencyUnitArray_currenciesDifferInArray() {
try {
Money[] array = new Money[] { GBP_2_33, JPY_423 };
Money.total(GBP, array);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstC... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_CurrencyUnitVarargs_nullFirst() {
Money.total(GBP, null, GBP_2_33, GBP_2_36);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_CurrencyUnitArray_nullFirst() {
Money[] array = new Money[] { null, GBP_2_33, GBP_2_36 };
Money.total(GBP, array);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_CurrencyUnitVarargs_nullNotFirst() {
Money.total(GBP, GBP_2_33, null, GBP_2_36);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_CurrencyUnitArray_nullNotFirst() {
Money[] array = new Money[] { GBP_2_33, null, GBP_2_36 };
Money.total(GBP, array);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Curr... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_factory_total_CurrencyUnitIterable_currenciesDiffer() {
try {
Iterable<Money> iterable = Arrays.asList(JPY_423);
Money.total(GBP, iterable);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstCu... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Curr... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_factory_total_CurrencyUnitIterable_currenciesDifferInIterable() {
try {
Iterable<Money> iterable = Arrays.asList(GBP_2_33, JPY_423);
Money.total(GBP, iterable);
} catch (CurrencyMismatchException ex) {
assertEqual... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_CurrencyUnitIterable_nullFirst() {
Iterable<Money> iterable = Arrays.asList(null, GBP_2_33, GBP_2_36);
Money.total(GBP, iterable);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'total' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_total_CurrencyUnitIterable_nullNotFirst() {
Iterable<Money> iterable = Arrays.asList(GBP_2_33, null, GBP_2_36);
Money.total(GBP, iterable);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'org.joda.money.Money' for the exception 'Ille... | ```java
@Test(expected = IllegalArgumentException.class)
public void test_factory_parse_String_tooShort() {
Money.parse("GBP ");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'org.joda.money.Money' for the exception 'Ille... | ```java
@Test(expected = IllegalArgumentException.class)
public void test_factory_parse_String_badCurrency() {
Money.parse("GBX 2.34");
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'parse' in class 'org.joda.money.Money' for the exception 'Null... | ```java
@Test(expected = NullPointerException.class)
public void test_factory_parse_String_nullString() {
Money.parse((String) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'org.joda.money.Money' for the exception 'Inv... | ```java
@Test(expected = InvocationTargetException.class)
public void test_constructor_null1() throws Exception {
Constructor<Money> con = Money.class.getDeclaredConstructor(BigMoney.class);
assertEquals(false, Modifier.isPublic(con.getModifiers()));
assertEquals(false, Modifier.isProtected(con.getModifiers... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method '<init>' in class 'org.joda.money.Money' for the exception 'Inv... | ```java
@Test(expected = InvocationTargetException.class)
public void test_constructor_scale() throws Exception {
Constructor<Money> con = Money.class.getDeclaredConstructor(BigMoney.class);
con.setAccessible(true);
con.newInstance(new Object[] { BigMoney.of(GBP, BIGDEC_2_3) });
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'readExternal' in class 'org.joda.money.Ser' for the exception ... | ```java
@Test(expected = InvalidObjectException.class)
public void test_serialization_invalidNumericCode() throws Exception {
CurrencyUnit cu = new CurrencyUnit("GBP", (short) 234, (short) 2);
Money m = Money.of(cu, 123.43d);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (ObjectOutputStr... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'readExternal' in class 'org.joda.money.Ser' for the exception ... | ```java
@Test(expected = InvalidObjectException.class)
public void test_serialization_invalidDecimalPlaces() throws Exception {
CurrencyUnit cu = new CurrencyUnit("GBP", (short) 826, (short) 3);
Money m = Money.of(cu, 123.43d);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (ObjectOutputS... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withCurrencyUnit' in class 'org.joda.money.Money' for the exce... | ```java
@Test(expected = ArithmeticException.class)
public void test_withCurrencyUnit_Currency_scaleProblem() {
GBP_2_34.withCurrencyUnit(JPY);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withCurrencyUnit' in class 'org.joda.money.Money' for the exce... | ```java
@Test(expected = NullPointerException.class)
public void test_withCurrencyUnit_Currency_nullCurrency() {
GBP_2_34.withCurrencyUnit((CurrencyUnit) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withCurrencyUnit' in class 'org.joda.money.Money' for the exce... | ```java
@Test(expected = ArithmeticException.class)
public void test_withCurrencyUnit_CurrencyRoundingMode_UNECESSARY() {
GBP_2_34.withCurrencyUnit(JPY, RoundingMode.UNNECESSARY);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withCurrencyUnit' in class 'org.joda.money.Money' for the exce... | ```java
@Test(expected = NullPointerException.class)
public void test_withCurrencyUnit_CurrencyRoundingMode_nullCurrency() {
GBP_2_34.withCurrencyUnit((CurrencyUnit) null, RoundingMode.UNNECESSARY);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getAmountMajorLong' in class 'org.joda.money.Money' for the ex... | ```java
@Test(expected = ArithmeticException.class)
public void test_getAmountMajorLong_tooBigPositive() {
GBP_LONG_MAX_MAJOR_PLUS1.getAmountMajorLong();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getAmountMajorLong' in class 'org.joda.money.Money' for the ex... | ```java
@Test(expected = ArithmeticException.class)
public void test_getAmountMajorLong_tooBigNegative() {
GBP_LONG_MIN_MAJOR_MINUS1.getAmountMajorLong();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getAmountMajorInt' in class 'org.joda.money.Money' for the exc... | ```java
@Test(expected = ArithmeticException.class)
public void test_getAmountMajorInt_tooBigPositive() {
GBP_INT_MAX_MAJOR_PLUS1.getAmountMajorInt();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getAmountMajorInt' in class 'org.joda.money.Money' for the exc... | ```java
@Test(expected = ArithmeticException.class)
public void test_getAmountMajorInt_tooBigNegative() {
GBP_INT_MIN_MAJOR_MINUS1.getAmountMajorInt();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getAmountMinorLong' in class 'org.joda.money.Money' for the ex... | ```java
@Test(expected = ArithmeticException.class)
public void test_getAmountMinorLong_tooBigPositive() {
GBP_LONG_MAX_PLUS1.getAmountMinorLong();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getAmountMinorLong' in class 'org.joda.money.Money' for the ex... | ```java
@Test(expected = ArithmeticException.class)
public void test_getAmountMinorLong_tooBigNegative() {
GBP_LONG_MIN_MINUS1.getAmountMinorLong();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getAmountMinorInt' in class 'org.joda.money.Money' for the exc... | ```java
@Test(expected = ArithmeticException.class)
public void test_getAmountMinorInt_tooBigPositive() {
GBP_INT_MAX_PLUS1.getAmountMinorInt();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'getAmountMinorInt' in class 'org.joda.money.Money' for the exc... | ```java
@Test(expected = ArithmeticException.class)
public void test_getAmountMinorInt_tooBigNegative() {
GBP_INT_MIN_MINUS1.getAmountMinorInt();
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withAmount' in class 'org.joda.money.Money' for the exception ... | ```java
@Test(expected = ArithmeticException.class)
public void test_withAmount_BigDecimal_invalidScale() {
GBP_2_34.withAmount(new BigDecimal("2.345"));
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withAmount' in class 'org.joda.money.Money' for the exception ... | ```java
@Test(expected = NullPointerException.class)
public void test_withAmount_BigDecimal_nullBigDecimal() {
GBP_2_34.withAmount((BigDecimal) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withAmount' in class 'org.joda.money.Money' for the exception ... | ```java
@Test(expected = ArithmeticException.class)
public void test_withAmount_BigDecimalRoundingMode_roundUnecessary() {
GBP_2_34.withAmount(new BigDecimal("2.345"), RoundingMode.UNNECESSARY);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withAmount' in class 'org.joda.money.Money' for the exception ... | ```java
@Test(expected = NullPointerException.class)
public void test_withAmount_BigDecimalRoundingMode_nullBigDecimal() {
GBP_2_34.withAmount((BigDecimal) null, RoundingMode.UNNECESSARY);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withAmount' in class 'org.joda.money.Money' for the exception ... | ```java
@Test(expected = NullPointerException.class)
public void test_withAmount_BigDecimalRoundingMode_nullRoundingMode() {
GBP_2_34.withAmount(BIGDEC_2_34, (RoundingMode) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withAmount' in class 'org.joda.money.Money' for the exception ... | ```java
@Test(expected = ArithmeticException.class)
public void test_withAmount_double_invalidScale() {
GBP_2_34.withAmount(2.345d);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withAmount' in class 'org.joda.money.Money' for the exception ... | ```java
@Test(expected = ArithmeticException.class)
public void test_withAmount_doubleRoundingMode_roundUnecessary() {
GBP_2_34.withAmount(2.345d, RoundingMode.UNNECESSARY);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'withAmount' in class 'org.joda.money.Money' for the exception ... | ```java
@Test(expected = NullPointerException.class)
public void test_withAmount_doubleRoundingMode_nullRoundingMode() {
GBP_2_34.withAmount(BIGDEC_2_34, (RoundingMode) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'plus' in class 'org.joda.money.Money' for the exception 'Curre... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_plus_Iterable_currencyMismatch() {
try {
Iterable<Money> iterable = Arrays.asList(GBP_2_33, JPY_423);
GBP_M5_78.plus(iterable);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstCurrency());
... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'plus' in class 'org.joda.money.Money' for the exception 'NullP... | ```java
@Test(expected = NullPointerException.class)
public void test_plus_Iterable_nullEntry() {
Iterable<Money> iterable = Arrays.asList(GBP_2_33, null);
GBP_M5_78.plus(iterable);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'plus' in class 'org.joda.money.Money' for the exception 'NullP... | ```java
@Test(expected = NullPointerException.class)
public void test_plus_Iterable_nullIterable() {
GBP_M5_78.plus((Iterable<Money>) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'plus' in class 'org.joda.money.Money' for the exception 'Curre... | ```java
@Test(expected = CurrencyMismatchException.class)
public void test_plus_Money_currencyMismatch() {
try {
GBP_M5_78.plus(USD_1_23);
} catch (CurrencyMismatchException ex) {
assertEquals(GBP, ex.getFirstCurrency());
assertEquals(USD, ex.getSecondCurrency());
throw ex;
}... |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'plus' in class 'org.joda.money.Money' for the exception 'NullP... | ```java
@Test(expected = NullPointerException.class)
public void test_plus_Money_nullMoney() {
GBP_M5_78.plus((Money) null);
}
```
</s> |
<s>[INST] <<SYS>>
You are a helpful programming assistant and an expert Java programmer. You are helping a user writing exceptional-behavior tests for their Java code.
<</SYS>>
Please complete an exceptional behavior test method in Java to test the method 'plus' in class 'org.joda.money.Money' for the exception 'Arith... | ```java
@Test(expected = ArithmeticException.class)
public void test_plus_BigDecimal_invalidScale() {
GBP_2_34.plus(new BigDecimal("1.235"));
}
```
</s> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.