Skip to content

Commit

Permalink
Fait passer le test
Browse files Browse the repository at this point in the history
  • Loading branch information
hal91190 committed Oct 25, 2017
1 parent e3fde02 commit 0a4a718
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/fr/uvsq/poo/compte/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.math.BigDecimal;

import static java.math.BigDecimal.ZERO;

/**
* La classe <code>Account</code> représente un compte bancaire.
*
Expand All @@ -17,6 +19,9 @@ class Account {
* @param initialBalance le montant initial
*/
public Account(BigDecimal initialBalance) {
if (initialBalance.compareTo(ZERO) < 0) {
throw new IllegalArgumentException("Montant invalide");
}
balance = initialBalance;
}

Expand Down

0 comments on commit 0a4a718

Please sign in to comment.