Пример #1
0
        public void Returns_Empty_Results_When_Given_Empty_List()
        {
            var finder = new Finder(
                new BirthdayDifferenceRepository(new List <Person.Person>()),
                AlgorithmsFactory.GetSmallestBirthdayDifference()
                );

            var result = finder.Find();

            Assert.Null(result.YoungerPerson);
            Assert.Null(result.OlderPerson);
        }
Пример #2
0
        public void Returns_Closest_Two_For_Four_People()
        {
            var finder = new Finder(
                new BirthdayDifferenceRepository(new List <Person.Person> {
                _greg, _mike, _sarah, _sue
            }),
                AlgorithmsFactory.GetSmallestBirthdayDifference());

            var result = finder.Find();

            Assert.Same(_sue, result.YoungerPerson);
            Assert.Same(_greg, result.OlderPerson);
        }