Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where tutors are saved wrongly to disk #64

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/seedu/address/storage/JsonAdaptedPerson.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -159,7 +160,7 @@ public Person toModelType() throws IllegalValueException {
final Hours modelHours = new Hours(hours);

final Set<Tag> modelTags = new HashSet<>(tuteeTags);
if (role == "Tutor") {
if (Objects.equals(role, "Tutor")) {
return new Tutor(modelName, modelPhone, modelEmail, modelAddress, modelHours, modelTags);
} else {
return new Tutee(modelName, modelPhone, modelEmail, modelAddress, modelHours, modelTags);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.nio.file.Path;
import java.nio.file.Paths;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -61,7 +60,6 @@ public void readAddressBook_invalidAndValidPersonAddressBook_throwDataLoadingExc
assertThrows(DataLoadingException.class, () -> readAddressBook("invalidAndValidPersonAddressBook.json"));
}

@Disabled
@Test
public void readAndSaveAddressBook_allInOrder_success() throws Exception {
Path filePath = testFolder.resolve("TempAddressBook.json");
Expand Down
2 changes: 0 additions & 2 deletions src/test/java/seedu/address/storage/StorageManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.nio.file.Path;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -48,7 +47,6 @@ public void prefsReadSave() throws Exception {
assertEquals(original, retrieved);
}

@Disabled
@Test
public void addressBookReadSave() throws Exception {
/*
Expand Down