public void SendRecEventNotification() { var enclosureController = new EnclosureController(); enclosureController.Request = new HttpRequestMessage(); enclosureController.Request.Headers.Add("Cookie", "session-id=123"); enclosureController.Request.RequestUri = new Uri("http://localhost:50000"); var allRecEvents = enclosureController.GetRecurringEvents(3, 1); Assert.AreEqual(0, allRecEvents.Count()); var currentTime = DateTime.Now; var recEve = new RecurringEvent { id = default(int), enclosureId = 3, day = (long)currentTime.DayOfWeek + 1, startTime = new TimeSpan(currentTime.Hour, currentTime.Minute + 3, currentTime.Second), endTime = new TimeSpan(currentTime.Hour, currentTime.Minute + 33, currentTime.Second), title = "בדיקה", description = "קקי", language = (long)Languages.he }; enclosureController.UpdateRecurringEvent(recEve); allRecEvents = enclosureController.GetRecurringEvents(3, 1); Assert.AreEqual(1, allRecEvents.Count()); var response = NotificationController.SendNotificationsOnlineRecurringEvents(); }
public void GetAllRecutnigEventsValidInput() { var encs = enclosureController.GetAllEnclosureResults((int)Languages.he); Assert.IsNotNull(encs); Assert.AreEqual(4, encs.Count()); var enc = encs.ElementAt(0); Assert.IsNotNull(enc); Assert.AreEqual(1, enc.Id); Assert.AreEqual("תצוגת הקופים", enc.Name); var recurringEvents = enclosureController.GetRecurringEvents((int)enc.Id, (int)Languages.he); Assert.IsNotNull(recurringEvents); Assert.AreEqual(1, recurringEvents.Count()); var recEvent = recurringEvents.ElementAt(0); Assert.IsNotNull(recEvent); Assert.AreEqual(1, recEvent.id); Assert.AreEqual(enc.Id, recEvent.enclosureId); Assert.AreEqual(enc.Language, recEvent.language); Assert.AreEqual(new TimeSpan(10, 30, 0), recEvent.startTime); Assert.AreEqual(new TimeSpan(11, 0, 0), recEvent.endTime); }