예제 #1
0
        public void ShouldReturnAllEntities()
        {
            var entityList = new List <Schedule>().AsQueryable();

            repositoryMock.Setup(x => x.GetAll()).Returns(entityList);

            var result = service.GetAll();

            Assert.AreEqual(entityList, result);
            repositoryMock.Verify(x => x.GetAll(), Times.Once());
        }
예제 #2
0
        protected async Task <IEnumerable <ScheduleUI> > LoadSchedules()
        {
            //Load the schedules from the database
            DateTime dt = DateFunctions.GetFirstDayOfWeek(DateTime.Now);

            dt  = dt.AddDays(DayOfWeek);
            Day = Day + ":" + dt.ToShortDateString();
            DateTime d;

            DateTime.TryParse(dt.ToShortDateString(), out d);
            Date      = d;
            Schedules = await ScheduleService.GetAll(dt);

            return(Schedules);
        }