コード例 #1
0
  @Test
  public void testReviewedAssignment() throws ParseException {
    final AssignmentView view =
        openLoginScreen()
            .login(ASSISTANT_USERNAME, ASSISTANT_PASSWORD)
            .listAssistingCourses()
            .get(0)
            .click()
            .listGroups()
            .get(0)
            .click()
            .toAssignmentView()
            .listAssignments()
            .get(0)
            .click();

    final CourseEdition course = courseEditions.find(1);
    final Group group = groups.find(course).get(0);
    final Delivery modelDelivery = deliveries.find(group, 1L);
    final Delivery.Review modelReview = modelDelivery.getReview();
    final AssignmentView.Review viewReview = view.getAssignment().getReview();

    assertEquals(modelReview.getGrade(), viewReview.getGrade().get(), 1e-4);
    assertEquals(modelReview.getReviewUser().getName(), viewReview.getReviewer().get());
    assertEquals(modelReview.getCommentary(), viewReview.getCommentary());
  }
コード例 #2
0
  @Test
  public void testAssignment() throws ParseException {
    final AssignmentView view =
        openLoginScreen()
            .login(ASSISTANT_USERNAME, ASSISTANT_PASSWORD)
            .listAssistingCourses()
            .get(0)
            .click()
            .listGroups()
            .get(0)
            .click()
            .toAssignmentView()
            .listAssignments()
            .get(1)
            .click();

    final CourseEdition course = courseEditions.find(1);
    final Group group = groups.find(course).get(0);
    final Delivery modelDelivery = deliveries.find(group, 2L);
    final Assignment modelAssignment = modelDelivery.getAssignment();
    final AssignmentView.Assignment viewAssignment = view.getAssignment();

    assertEquals(modelDelivery.getCreatedUser().getName(), viewAssignment.getAuthor());
    assertEquals(modelAssignment.getName(), viewAssignment.getName());
    assertEquals(modelDelivery.getState(), viewAssignment.getStatus());
  }