@@ -59,9 +59,7 @@ void testAddMoney_DifferentCurrency() {
59
59
Money money1 = new Money (100.00 , "USD" );
60
60
Money money2 = new Money (50.25 , "EUR" );
61
61
62
- assertThrows (
63
- CannotAddTwoCurrienciesException .class ,
64
- () -> money1 .addMoney (money2 ));
62
+ assertThrows (CannotAddTwoCurrienciesException .class , () -> money1 .addMoney (money2 ));
65
63
}
66
64
67
65
@ Test
@@ -81,9 +79,7 @@ void testSubtractMoney_DifferentCurrency() {
81
79
Money money1 = new Money (100.00 , "USD" );
82
80
Money money2 = new Money (50.25 , "EUR" );
83
81
84
- assertThrows (
85
- CannotSubtractException .class ,
86
- () -> money1 .subtractMoney (money2 ));
82
+ assertThrows (CannotSubtractException .class , () -> money1 .subtractMoney (money2 ));
87
83
}
88
84
89
85
@ Test
@@ -92,9 +88,7 @@ void testSubtractMoney_AmountTooLarge() {
92
88
Money money1 = new Money (50.00 , "USD" );
93
89
Money money2 = new Money (60.00 , "USD" );
94
90
95
- assertThrows (
96
- CannotSubtractException .class ,
97
- () -> money1 .subtractMoney (money2 ));
91
+ assertThrows (CannotSubtractException .class , () -> money1 .subtractMoney (money2 ));
98
92
}
99
93
100
94
@ Test
@@ -112,9 +106,7 @@ void testMultiply_NegativeFactor() {
112
106
// Test multiplying by a negative factor
113
107
Money money = new Money (100.00 , "USD" );
114
108
115
- assertThrows (
116
- IllegalArgumentException .class ,
117
- () -> money .multiply (-2 ));
109
+ assertThrows (IllegalArgumentException .class , () -> money .multiply (-2 ));
118
110
}
119
111
120
112
@ Test
@@ -133,15 +125,12 @@ void testExchangeCurrency_NegativeExchangeRate() {
133
125
// Test converting currency with a negative exchange rate
134
126
Money money = new Money (100.00 , "USD" );
135
127
136
- assertThrows (
137
- IllegalArgumentException .class ,
138
- () -> money .exchangeCurrency ("EUR" , -0.85 ));
128
+ assertThrows (IllegalArgumentException .class , () -> money .exchangeCurrency ("EUR" , -0.85 ));
139
129
}
140
130
141
131
@ Test
142
132
void testAppExecution () {
143
133
assertDoesNotThrow (
144
- () -> App .main (new String [] {}),
145
- "App execution should not throw any exceptions" );
134
+ () -> App .main (new String [] {}), "App execution should not throw any exceptions" );
146
135
}
147
136
}
0 commit comments