Добавил тесты проведения, повторного проведения и изменения сумм операций

This commit is contained in:
Kashey committed 2026-10-19 14:05:42 +03:00
1 parent d264ed6583
commit 8af851a49a
18 files changed
+303 -35

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
package model;
import java.util.Objects;
public class Account {
private String name;
private final Long id;
public Account(Long id, String name) {
this.id = Objects.requireNonNull(id, "Не указан идентификатор");
setName(name);
}
public Long getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
if (name == null || name.isBlank()) {
throw new IllegalArgumentException("Не указано имя счёта");
}
this.name = name;
}
@Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
Account account = (Account) o;
return Objects.equals(id, account.id);
}
@Override
public int hashCode() {
return id.hashCode();
}
}