コード例 #1
0
ファイル: ProjectTest.java プロジェクト: HendrikKolver/COS301
 /** Test of getUsers method, of class Project. */
 @Test
 public void testGetUsers() {
   try {
     System.out.println("getUsers");
     Project instance = new Project();
     instance.addUser("Jannie");
     Object[] result = instance.getUsers();
     if (!result[0].equals("Jannie")) fail("GetUsers(), test failed values not correct");
   } catch (Exception e) {
     fail("GetUsers(), test failed");
   }
 }
コード例 #2
0
ファイル: ProjectTest.java プロジェクト: HendrikKolver/COS301
  /** Test of getUsersNotOnProject method, of class Project. */
  @Test
  public void testGetUsersNotOnProject() {
    try {
      System.out.println("getUsersNotOnProject");
      Reference.usernames.add(new User("j", "j", "j", "j"));
      Reference.usernames.add(new User("k", "k", "k", "k"));
      Project instance = new Project();
      instance.addUser("j");

      String[] result = instance.getUsersNotOnProject();
      System.out.println(result[0]);
      for (int i = 0; i < result.length; i++) {
        if (result[i].equals("j")) fail("GetUsersNotOnProject(), value incorrect");
      }

    } catch (Exception e) {
      fail("GetUsersNotOnProject(), exception");
    }
  }