コード例 #1
0
        public void Should_Return_If_Get_This_Week_Birthdays_Returns_Wrong_Users_1()
        {
            var time      = new DateTime(2015, 11, 29);
            var birthdays = _birthdayService.GetWeeklyBirthdays(time).ToArray();

            Assert.AreEqual(3, birthdays.Count());
            Assert.AreEqual("testUserId2", birthdays[0].Id);
            Assert.AreEqual("Saturday", birthdays[0].DayOfWeek);
            Assert.AreEqual("2015-12-05", birthdays[0].DateString);
        }
コード例 #2
0
        public IEnumerable <BirthdayViewModel> GetWeeklyBirthdays()
        {
            var todayDate    = DateTime.UtcNow;
            var birthdaysDTO = _birthdayService.GetWeeklyBirthdays(todayDate);
            var birthdays    = _mapper.Map <IEnumerable <BirthdayDTO>, IEnumerable <BirthdayViewModel> >(birthdaysDTO);

            return(birthdays);
        }