Beispiel #1
0
  @Test
  public void recruitersCanListJobsTheyPosted() {
    setupActors();
    JobRepository jobRepository = new JobRepository();

    recruiter.post(developerJob).to(jobRepository);
    recruiter.post(architectJob).to(jobRepository);

    JobPostings jobPostings = recruiter.getPostedJobs().from(jobRepository);

    assertTrue(jobPostings.contains(developerJob));
    assertTrue(jobPostings.contains(architectJob));
    assertFalse(jobPostings.contains(programmerJob));
  }
Beispiel #2
0
  @Test
  public void recruitersCanDisplayJobsTheyPosted() {
    setupActors();
    JobRepository jobRepository = new JobRepository();

    JobPosting developerPosting = recruiter.post(developerJob).to(jobRepository);
    JobPosting architectPosting = recruiter.post(architectJob).to(jobRepository);
    JobPosting programmerPosting = recruiter.post(programmerJob).to(jobRepository);

    JobPostings jobPostings = recruiter.getPostedJobs().from(jobRepository);

    JobPostingsDisplayer postingsDisplayer = Mockito.mock(JobPostingsDisplayer.class);
    jobPostings.displayTo(postingsDisplayer);
    Mockito.verify(postingsDisplayer)
        .displayJobPostings(
            Matchers.argThat(
                new SetOfThreeJobPostings(developerPosting, architectPosting, programmerPosting)));
  }