public void testUserFromJsonEmpty() throws Exception { User test = JsonConverter.userFromJson(jsonEmpty); assertTrue(test.toString().equals("KeaneKK403")); assertTrue(test.getFirstName().equals("")); assertTrue(test.getUsername().equals("KeaneKK")); assertTrue(test.getId() == 403); assertTrue(test.getLastName().equals("")); assertTrue(test.getCity().equals("")); assertTrue(test.getCountry().equals("")); assertTrue(test.getSchool().equals("")); assertTrue(test.getCourses().equals("")); assertTrue(test.getGeneralDescription().equals("")); assertTrue(test.getHelpDescription().equals("")); }
public void testUserFromJsonFull() throws Exception { User test = JsonConverter.userFromJson(jsonFull); assertTrue(test.toString().equals("KeaneK402")); assertTrue(test.getFirstName().equals("Keane")); assertTrue(test.getUsername().equals("KeaneK")); assertTrue(test.getId() == 402); assertTrue(test.getLastName().equals("Kraus")); assertTrue(test.getCity().equals("Winnipeg")); assertTrue(test.getCountry().equals("Canada")); assertTrue(test.getSchool().equals("UofM")); assertTrue(test.getCourses().equals("COMP4350")); assertTrue(test.getGeneralDescription().equals("Gamer")); assertTrue(test.getHelpDescription().equals("Help")); }