Skip to content

Commit

Permalink
Merge pull request nus-cs2113-AY2021S1#52 from manuelmanuntag96/Manue…
Browse files Browse the repository at this point in the history
…l-Assertion

Implemented Assertion in LogInCommand.java
  • Loading branch information
yeapcl authored Oct 14, 2020
2 parents 93531f8 + e2a4714 commit b43fca0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ text-ui-test/EXPECTED-UNIX.TXT
AddCommand.log
LogInCommand.log.1
LogInCommand.log
LogInCommand.log.lck
8 changes: 6 additions & 2 deletions src/main/java/seedu/duke/command/LogInCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public void execute(UserList users, Ui ui, User nowUser/*, Storage storage*/) th
setupInputLogger();

String[] parsedInputs = input.split(" /", 2);

assert parsedInputs.length == 2 : "Username or Password is missing";

for (int i = 1; i <= users.getTotalUserCount(); i++) {
if (parsedInputs[0].equals((users.getUser(i)).getName())) {
if (parsedInputs[1].equals((users.getUser(i)).getPassWord())) {
Expand All @@ -56,8 +59,9 @@ public void execute(UserList users, Ui ui, User nowUser/*, Storage storage*/) th
}
ui.greetUser(currentUser);
isLogIn = true;

logger.log(Level.INFO, "end of processing");
assert isLogIn() == true : "Username or Password is missing";

logger.log(Level.INFO, "end of processing" + "\n");

//storage.write(tasks);
}
Expand Down

0 comments on commit b43fca0

Please sign in to comment.