public void JoeAndJackDaltonGetEmployed()
        {
            // Arrange
            var joeDalton  = new JobSeeker("Joe Dalton");
            var jackDalton = new JobSeeker("Jack Dalton");

            var jobPostings = new JobPostings();

            jobPostings.Subscribe(joeDalton, jackDalton);

            // Act
            jobPostings.AddJob(new JobPost("Bank Robbery"));

            // Assert
            Assert.True(joeDalton.IsEmployed());
            Assert.True(jackDalton.IsEmployed());
        }
        public void JackDaltonNotInterestedInGettingJob()
        {
            // Arrange
            var joeDalton  = new JobSeeker("Joe Dalton");
            var jackDalton = new JobSeeker("Jack Dalton");

            var jobPostings = new JobPostings();

            jobPostings.Subscribe(joeDalton, jackDalton);

            // (Jack is not intereseted in job)
            jobPostings.Unsubscribe(jackDalton);

            // Act
            jobPostings.AddJob(new JobPost("Bank Robbery"));

            // Assert
            Assert.True(joeDalton.IsEmployed());
            Assert.False(jackDalton.IsEmployed());
        }
Exemplo n.º 3
0
 public void Unsubscribe(JobSeeker jackDalton) => this.jobSeekers.Remove(jackDalton);