Exemplo n.º 1
0
        public void ModelPropertyTest(string group)
        {
            var list = ServerApiRepository.GetLessonList(group);

            Assert.IsNotNull(list);
            var data = list.First();

            Assert.IsNotNull(data.DataDay);
            Assert.IsNotNull(data.Place);
            //Assert.IsNotNull(data.Room);
            Assert.IsNotNull(data.Status);
            //Assert.IsNotNull(data.Teacher);
            Assert.IsNotNull(data.StartTime);
            Assert.IsNotNull(data.SubjectTitle);
            Assert.IsNotNull(data.DataWeek);
        }
        public static string CreateDailyMessage(string groupName, DataWeekType week, int day)
        {
            //List<ScheduleItemModel> localSchedule = LocalStorageRepository.GetLessonList(groupName, day, week);
            var    isuSchedule = ServerApiRepository.GetLessonList(groupName, (DataDayType)day, week);
            string header      = AnswerGeneratorService.GenerateHeader(week, day);

            return(header);
            //TODO: fix
            //return header += string.Join("\n", isuSchedule.Select(AnswerGeneratorService.LessonToString));

            //TODO: fix this

/*
 *          if (isuSchedule == null)
 *          {
 *              //TODO: isu empty
 *              if (localSchedule == null)
 *              {
 *                  //TODO: isu and local empty
 *              }
 *          }
 *          else
 *          {
 *              if (localSchedule == null)
 *              {
 *                  //TODO: no local data
 *              }
 *              else
 *              {
 *                  if (isuSchedule.Except(localSchedule).Any())
 *                  {
 *                      return header + AnswerGeneratorService.DifferentSchedule(isuSchedule, localSchedule);
 *                  }
 *
 *                  if (!isuSchedule.Any())
 *                  {
 *                      return header += AnswerGeneratorService.NoLessonMessage();
 *                  }
 *
 *                  return header += string.Join("\n", isuSchedule.Select(AnswerGeneratorService.LessonToString));
 *              }
 *          }
 *
 *          return header;
 */
        }
Exemplo n.º 3
0
        public void MondayLessonList(int day, DataWeekType weekType, int count)
        {
            var lessons = ServerApiRepository.GetLessonList(GroupName, (DataDayType)day, weekType);

            Assert.AreEqual(lessons.Count, count);
        }
Exemplo n.º 4
0
        public void DayLessonList_NotEmpty()
        {
            var lessons = ServerApiRepository.GetLessonList(GroupName, DataDayType.Monday, DataWeekType.Both);

            Assert.IsTrue(lessons.Any());
        }
Exemplo n.º 5
0
        public void LessonList_NotEmpty()
        {
            var lessons = ServerApiRepository.GetLessonList(GroupName);

            Assert.IsTrue(lessons.Any());
        }
Exemplo n.º 6
0
        public void LessonList_NotNull()
        {
            var lessons = ServerApiRepository.GetLessonList(GroupName);

            Assert.IsNotNull(lessons);
        }