Ejemplo n.º 1
0
 public void ValidYear_ReturnsTrueForValidYears()
 {
     Assert.True(DoctorValidator.ValidYear(1963));
     Assert.True(DoctorValidator.ValidYear(1970));
     Assert.True(DoctorValidator.ValidYear(1995));
     Assert.True(DoctorValidator.ValidYear(2003));
     Assert.True(DoctorValidator.ValidYear(2011));
     Assert.True(DoctorValidator.ValidYear(2049));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the doctors who portrayed the doctor in a given year.
        /// </summary>
        /// <param name="year">The year to lookup doctors by.</param>
        /// <returns>The doctors who portrayed the doctor in a given year.</returns>
        public IEnumerable <Doctor> GetDoctorsForYear(int year)
        {
            if (!DoctorValidator.ValidYear(year))
            {
                return(new List <Doctor>());
            }

            return(_theDoctors.Where(doc => doc.Years.Contains(year)));
        }
Ejemplo n.º 3
0
 public void ValidYear_ReturnsFalseForYearsSignificantlyAfterCurrentYear()
 {
     Assert.False(DoctorValidator.ValidYear(2050));
 }
Ejemplo n.º 4
0
 public void ValidYear_ReturnsFalseForYearsBeforeShowStart()
 {
     Assert.False(DoctorValidator.ValidYear(1962));
 }