Merge pull request #12 from ebivibe/DBBranch

Db branch
This commit is contained in:
FunwithaPorpoise 2018-10-22 14:25:17 -04:00 committed by GitHub
commit 04362b99c0
2 changed files with 6 additions and 1 deletions

View file

@ -230,10 +230,10 @@ public class DBHelper extends SQLiteOpenHelper {
user[j] = cursor.getString(j); user[j] = cursor.getString(j);
} }
listOfUsers.add(user); listOfUsers.add(user);
cursor.moveToNext();
} }
} }
cursor.close(); cursor.close();
return listOfUsers; return listOfUsers;
} }
} }

View file

@ -115,6 +115,10 @@ public class DBIntegrationTest {
List<String[]> allUsers = dbHelper.getAllUsers(); List<String[]> allUsers = dbHelper.getAllUsers();
for (String[] user : allUsers){ for (String[] user : allUsers){
// for (String s : user){
// System.out.print(s + " ");
// }
// System.out.println();
UserType usertype = dbHelper.findUserByUsername(user[0]); UserType usertype = dbHelper.findUserByUsername(user[0]);
assertEquals(usertype.getFirstname(), user[1]); assertEquals(usertype.getFirstname(), user[1]);
assertEquals(usertype.getLastname(), user[2]); assertEquals(usertype.getLastname(), user[2]);
@ -123,5 +127,6 @@ public class DBIntegrationTest {
dbHelper.deleteUser("jbO4aBF4dC"); dbHelper.deleteUser("jbO4aBF4dC");
} }
} }