start test for csv dao
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
qvalentin 2022-05-13 19:13:02 +02:00
parent f558de5fa9
commit f616b4b4bf
4 changed files with 114 additions and 2 deletions

View file

@ -5,6 +5,8 @@ import category.CategoryId;
import category.CategoryName;
import persistence.csv.CSVSerializable;
import java.util.Objects;
public class CategoryEntity implements CSVSerializable {
private final String name;
@ -36,4 +38,17 @@ public class CategoryEntity implements CSVSerializable {
public String toCSVString() {
return name + CSVSerializable.seperator + Integer.toString(id);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CategoryEntity that = (CategoryEntity) o;
return id == that.id && Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(name, id);
}
}