Beispiel #1
0
        public void CanNotScheduleContent()
        {
            IContentManagerService cs = CreateContentManagerService();

            DateTime from = DateTime.Today;
            DateTime to   = DateTime.Today.AddDays(-30);

            Content c = cs.ScheduleContent(1, from, to);
        }
Beispiel #2
0
        public void CanScheduleContent()
        {
            IContentManagerService cs = CreateContentManagerService();

            DateTime from = DateTime.Today;
            DateTime to   = DateTime.Today.AddDays(30);

            Content c = cs.ScheduleContent(1, from, to);

            Assert.IsTrue(DateTime.Today >= c.ScheduleFrom & DateTime.Today <= c.ScheduleTo);
        }
        public ActionResult Schedule(Schedule schedule)
        {
            DateTime from = Convert.ToDateTime(schedule.From);
            DateTime?to   = null;

            if (!string.IsNullOrEmpty(schedule.To))
            {
                to = Convert.ToDateTime(schedule.To);
            }

            contentManagerService.ScheduleContent(schedule.ContentId, from, to);
            return(Json(new { Success = true }));
        }