public void OnBeforeTestsStarts() { var mvcProxy = new MvcControllerProxy(); mvcProxy.ControllerName = typeof(EventSchedulerController).FullName; var templateId = ServerOperations.Templates().CreateHybridMVCPageTemplate(CaptionCalendar); ServerOperationsFeather.TemplateOperations().AddControlToTemplate(templateId, mvcProxy, PlaceHolderId, CaptionCalendar); ServerOperations.Events().CreateEvent(Event1Title, string.Empty, false, this.eventStart, this.eventEnd); var event1Item = EventsManager.GetManager() .GetEvents() .Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event1Title) .FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event1Id", event1Item.Id.ToString()); ServerOperations.Events().CreateEvent(Event2Title, string.Empty, false, this.eventStart, this.eventEnd); var event2Item = EventsManager.GetManager() .GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event2Title) .FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event2Id", event2Item.Id.ToString()); }
public void EventWidget_AllEvents_FilterByCalendar() { var methodName = MethodInfo.GetCurrentMethod().Name; var calendarId = ServerOperations.Events().CreateCalendar(Guid.NewGuid(), "custom_calendar"); ServerOperations.Events().CreateEvent(methodName + "_fromdefault", "some content", false, DateTime.Now, DateTime.Now.AddHours(2), ServerOperations.Events().GetDefaultCalendarId()); ServerOperations.Events().CreateEvent(methodName + "_fromcustom", "some content", false, DateTime.Now, DateTime.Now.AddHours(2), calendarId); try { var mvcProxy = new MvcControllerProxy(); mvcProxy.ControllerName = typeof(EventController).FullName; var eventController = new EventController(); eventController.Model.NarrowSelectionMode = Telerik.Sitefinity.Frontend.Mvc.Models.SelectionMode.FilteredItems; eventController.Model.SerializedNarrowSelectionFilters = this.GetNarrowSelectionSerializedQueryData("Calendars", "Parent.Id.ToString()", "Parent.Id", calendarId, "System.String"); mvcProxy.Settings = new ControllerSettings(eventController); using (var generator = new PageContentGenerator()) { generator.CreatePageWithWidget(mvcProxy, null, methodName, methodName, methodName, 0); var pageContent = WebRequestHelper.GetPageWebContent(RouteHelper.GetAbsoluteUrl("~/" + methodName + "0")); Assert.Contains(pageContent, methodName + "_fromcustom", System.StringComparison.Ordinal); Assert.DoesNotContain(pageContent, methodName + "_fromdefault", System.StringComparison.Ordinal); } } finally { ServerOperations.Events().DeleteAllEvents(); ServerOperations.Events().DeleteCalendar(calendarId); } }
public void TearDown() { ServerOperations.Pages().DeleteAllPages(); ServerOperations.News().DeleteAllNews(); ServerOperations.Events().DeleteAllEvents(); ServerOperations.Templates().DeletePageTemplate(TemplateTitle); }
public void OnAfterTestCompletes() { ServerOperations.Pages().DeleteAllPages(); ServerOperations.Events().DeleteAllCalendarsExceptDefaultOne(); ServerOperations.Events().DeleteAllEvents(); ServerOperations.Templates().DeletePageTemplate(CaptionCalendar); }
public void SetUp() { var templateId = ServerOperations.Templates().GetTemplateIdByTitle(TemplateTitle); ServerOperations.Pages().CreatePage(PageName, templateId); ServerOperations.Events().CreateEvent(EventsTitle); }
public void OnBeforeTestsStarts() { var templateId = ServerOperations.Templates().GetTemplateIdByTitle(TemplateTitle); Guid page1Id = ServerOperations.Pages().CreatePage(PageTitle, templateId); var page1NodeId = ServerOperations.Pages().GetPageNodeId(page1Id); ServerOperationsFeather.Pages().AddCalendarWidgetToPage(page1NodeId, PlaceHolderId); ServerOperations.Events().CreateCalendar(this.calendar1Guid, Calendar1Title); ServerOperations.Events().CreateEvent(Event1Title, string.Empty, IsAllDay, this.eventStart, this.eventEnd, this.calendar1Guid); var event1Item = EventsManager.GetManager() .GetEvents() .Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event1Title) .FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event1Id", event1Item.Id.ToString()); ServerOperations.Events().CreateCalendar(this.calendar2Guid, Calendar2Title); ServerOperations.Events().CreateEvent(Event2Title, string.Empty, IsAllDay, this.eventStart, this.eventEnd, this.calendar2Guid); var event2Item = EventsManager.GetManager() .GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event2Title) .FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event2Id", event2Item.Id.ToString()); }
public void OnBeforeTestsStarts() { var templateId = ServerOperations.Templates().CreateHybridMVCPageTemplate(TemplateName); Guid pageId = ServerOperations.Pages().CreatePage(PageTitle, templateId); var pageNodeId = ServerOperations.Pages().GetPageNodeId(pageId); ServerOperationsFeather.Pages().AddCalendarWidgetToPage(pageNodeId, PlaceHolderId); ServerOperations.Events().CreateEvent(CurrentEventTitle, string.Empty, false, this.currentEventStartTime, this.currentEventEndTime); var currentEventItem = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == CurrentEventTitle).FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("currentEventId", currentEventItem.Id.ToString()); ServerOperations.Events().CreateEvent(BasePastInOneDayEventTitle, string.Empty, false, this.basePastInOneDayEventStartTime, this.basePastInOneDayEventEndTime); var pastEventItem = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == BasePastInOneDayEventTitle).FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("pastEventId", pastEventItem.Id.ToString()); ServerOperations.Events().CreateEvent(BaseUpcomingInOneDayEventTitle, string.Empty, false, this.baseUpcomingInOneDayEventStartTime, this.baseUpcomingInOneDayEventEndTime); var upcomingEventItem = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == BaseUpcomingInOneDayEventTitle).FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("upcomingEventId", upcomingEventItem.Id.ToString()); ServerArrangementContext.GetCurrent().Values.Add("timezoneId", TimeZoneInfo.Utc.ToString()); }
public void EventWidget_AllEvents_DisplayAll() { var methodName = MethodInfo.GetCurrentMethod().Name; try { this.BuildEvents(methodName); var eventController = new EventController(); eventController.Model.DisplayMode = ListDisplayMode.Paging; eventController.Model.SelectionMode = SelectionMode.AllItems; var mvcProxy = new MvcControllerProxy() { Settings = new ControllerSettings(eventController), ControllerName = typeof(EventController).FullName }; var containedEvents = new string[] { CurrentEventNameFormat, NextWeekEventNameFormat, NextMonthEventNameFormat, PreviousMonthEventNameFormat, PreviousWeekEventNameFormat }.Select(s => string.Format(CultureInfo.InvariantCulture, s, methodName)); using (var generator = new PageContentGenerator()) { generator.CreatePageWithWidget(mvcProxy, null, methodName, methodName, methodName, 0); var pageContent = WebRequestHelper.GetPageWebContent(RouteHelper.GetAbsoluteUrl("~/" + methodName + "0")); foreach (var title in containedEvents) { Assert.Contains(pageContent, title, StringComparison.Ordinal); } } } finally { ServerOperations.Events().DeleteAllEvents(); } }
public void SetUp() { var templateId = ServerOperations.Templates().CreatePureMVCPageTemplate(TemplateTitle); Telerik.Sitefinity.TestUtilities.CommonOperations.ServerOperations.Pages().CreatePage(PageName, templateId); ServerOperationsFeather.NewsOperations().CreatePublishedNewsItem(NewsTitle, NewsContent, "AuthorName", "SourceName", null, null, null); ServerOperations.Events().CreateEvent(EventsTitle); }
public void SetUp() { string templateName = ServerArrangementContext.GetCurrent().Values["templateName"]; Guid templateId = ServerOperations.Templates().GetTemplateIdByTitle(templateName); ServerOperations.Pages().CreatePage(PageName, templateId); ServerOperations.Events().CreateEvent(EventsTitle); }
public void SetUp() { Guid pageId = ServerOperations.Pages().CreatePage(PageName); ServerOperations.Events().CreateEvent(EventsTitle); ServerOperationsFeather.Pages().AddEventsWidgetToPage(pageId, PlaceHolderId); ServerOperationsFeather.Pages().AddBreadcrumbWidgetToPage(pageId, PlaceHolderId); }
private void BuildEvents(string methodName) { var calendarId = ServerOperations.Events().GetDefaultCalendarId(); ServerOperations.Events().CreateEvent(string.Format(CultureInfo.InvariantCulture, CurrentEventNameFormat, methodName), "some content", false, DateTime.UtcNow.AddMinutes(-1), DateTime.UtcNow.AddMinutes(1), calendarId); ServerOperations.Events().CreateEvent(string.Format(CultureInfo.InvariantCulture, NextWeekEventNameFormat, methodName), "some content", false, DateTime.UtcNow.AddDays(5), DateTime.UtcNow.AddDays(5).AddMinutes(2), calendarId); ServerOperations.Events().CreateEvent(string.Format(CultureInfo.InvariantCulture, NextMonthEventNameFormat, methodName), "some content", false, DateTime.UtcNow.AddMonths(1), DateTime.UtcNow.AddMonths(1).AddMinutes(2), calendarId); ServerOperations.Events().CreateEvent(string.Format(CultureInfo.InvariantCulture, PreviousWeekEventNameFormat, methodName), "some content", false, DateTime.UtcNow.AddDays(-5), DateTime.UtcNow.AddDays(-5).AddMinutes(2), calendarId); ServerOperations.Events().CreateEvent(string.Format(CultureInfo.InvariantCulture, PreviousMonthEventNameFormat, methodName), "some content", false, DateTime.UtcNow.AddMonths(-1), DateTime.UtcNow.AddMonths(-1).AddMinutes(2), calendarId); }
public void OnBeforeTestsStarts() { var templateId = ServerOperations.Templates().GetTemplateIdByTitle(TemplateTitle); Guid pageId = ServerOperations.Pages().CreatePage(PageTitle, templateId); ServerOperations.Events().CreateEvent(EventsTitle); var pageNodeId = ServerOperations.Pages().GetPageNodeId(pageId); ServerOperationsFeather.Pages().AddCalendarWidgetToPage(pageNodeId, PlaceHolderId); }
public void SetUp() { Guid pageId = ServerOperations.Pages().CreatePage(PageName); for (int i = 1; i < 6; i++) { ServerOperations.Events().CreateEvent(EventsTitle + i); } ServerOperationsFeather.Pages().AddEventsWidgetToPage(pageId, "Body"); }
public static void CreateEvents() { ServerOperations.Events().CreateEvent(EventsTestsCommon.BaseEventTitle); ServerOperations.Events().CreateEvent(EventsTestsCommon.BasePastInTwoDaysEventTitle, string.Empty, false, DateTime.Now.AddDays(-5), DateTime.Now.AddDays(-2)); ServerOperations.Events().CreateEvent(EventsTestsCommon.BasePastInFourDaysEventTitle, string.Empty, false, DateTime.Now.AddDays(-6), DateTime.Now.AddDays(-4)); ServerOperations.Events().CreateEvent(EventsTestsCommon.BaseUpcomingInOneDayEventTitle, string.Empty, false, DateTime.Now.AddDays(1), DateTime.Now.AddDays(2)); ServerOperations.Events().CreateEvent(EventsTestsCommon.BaseUpcomingInThreeDaysEventTitle, string.Empty, false, DateTime.Now.AddDays(3), DateTime.Now.AddDays(4)); ServerOperations.Events().CreateEvent(EventsTestsCommon.BaseAllDayEventTitle, string.Empty, true, DateTime.Now, DateTime.Now.AddHours(1)); ServerOperations.Events().CreateDailyRecurrentEvent(EventsTestsCommon.BaseRepeatEventTitle, string.Empty, DateTime.Now, DateTime.Now.AddHours(1), 60, 5, 1, TimeZoneInfo.Local.Id); ServerOperations.Events().CreateDraftEvent(EventsTestsCommon.BaseDraftEventTitle, string.Empty, false, DateTime.Now, DateTime.Now.AddHours(1)); }
public void Setup() { this.pageOperations = new FeatherWidgets.TestUtilities.CommonOperations.PagesOperations(); ServerOperations.Events().CreateEvent(EventWidgetTests.BaseEventTitle); ServerOperations.Events().CreateEvent(EventWidgetTests.BasePastEventTitle, string.Empty, false, DateTime.Now.AddDays(-2), DateTime.Now.AddDays(-1)); ServerOperations.Events().CreateEvent(EventWidgetTests.BaseUpcomingEventTitle, string.Empty, false, DateTime.Now.AddDays(1), DateTime.Now.AddDays(2)); ServerOperations.Events().CreateEvent(EventWidgetTests.BaseAllDayEventTitle, string.Empty, true, DateTime.Now, DateTime.Now.AddHours(1)); ServerOperations.Events().CreateDailyRecurrentEvent(EventWidgetTests.BaseRepeatEventTitle, string.Empty, DateTime.Now, DateTime.Now.AddHours(1), 60, 5, 1, TimeZoneInfo.Local.StandardName); ServerOperations.Events().CreateDraftEvent(EventWidgetTests.BaseDraftEventTitle, string.Empty, false, DateTime.Now, DateTime.Now.AddHours(1)); }
public void OnBeforeTestsStarts() { var templateId = ServerOperations.Templates().GetTemplateIdByTitle(TemplateTitle); Guid pageId = ServerOperations.Pages().CreatePage(PageTitle, templateId); var pageNodeId = ServerOperations.Pages().GetPageNodeId(pageId); ServerOperationsFeather.Pages().AddCalendarWidgetToPage(pageNodeId, PlaceHolderId); var event1End = this.event1Start.AddMonths(3).AddDays(1); ServerOperations.Events().CreateAllDayEvent(Event1Title, string.Empty, this.event1Start, event1End); var event1Item = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event1Title).FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event1Id", event1Item.Id.ToString()); ServerArrangementContext.GetCurrent().Values.Add("timezoneId", TimeZoneInfo.Utc.ToString()); }
public void OnBeforeTestsStarts() { ServerOperations.Events().CreateEvent(Event1Title, string.Empty, false, this.eventStart, this.eventEnd); var event1Item = EventsManager.GetManager() .GetEvents() .Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event1Title) .FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event1Id", event1Item.Id.ToString()); ServerOperations.Events().CreateEvent(Event2Title, string.Empty, false, this.eventStart, this.eventEnd); var event2Item = EventsManager.GetManager() .GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event2Title) .FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event2Id", event2Item.Id.ToString()); }
public void OnBeforeTestsStarts() { var templateId = ServerOperations.Templates().GetTemplateIdByTitle(TemplateTitle); Guid pageId = ServerOperations.Pages().CreatePage(PageTitle, templateId); var pageNodeId = ServerOperations.Pages().GetPageNodeId(pageId); ServerOperationsFeather.Pages().AddCalendarWidgetToPage(pageNodeId, PlaceHolderId); var еventStartTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0, DateTimeKind.Utc); var еventEndTime = DateTime.Now.AddYears(5); ServerOperations.Events().CreаteAllDayRecurrentEvent(Event1Title, string.Empty, еventStartTime, еventEndTime, 1440, this.occurenceCount, 1, true); var event1Item = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event1Title).FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event1Id", event1Item.Id.ToString()); var еventExpectedStartTime = this.FormatTime(еventStartTime); ServerArrangementContext.GetCurrent().Values.Add("еventStartTime", еventExpectedStartTime); }
public void OnBeforeTestsStarts() { var templateId = ServerOperations.Templates().GetTemplateIdByTitle(TemplateTitle); Guid pageId = ServerOperations.Pages().CreatePage(PageTitle, templateId); var pageNodeId = ServerOperations.Pages().GetPageNodeId(pageId); ServerOperationsFeather.Pages().AddCalendarWidgetToPage(pageNodeId, PlaceHolderId); var difference = this.event1EndTime - this.event1StartTime; var occurancesCount1 = difference.TotalDays; int occurancesCount = (int)occurancesCount1; ServerOperations.Events().CreateDailyRecurrentEvent(Event1Title, string.Empty, this.event1StartTime, this.event1EndTime, 60, occurancesCount, 1, TimeZoneInfo.Local.Id); var event1Item = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event1Title).FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event1Id", event1Item.Id.ToString()); ServerArrangementContext.GetCurrent().Values.Add("timezoneId", TimeZoneInfo.Utc.ToString()); }
public void EventWidget_AllEvents_FilterByCustomHierarchicalCategories() { var methodName = MethodInfo.GetCurrentMethod().Name; ServerOperations.Events().CreateEvent(methodName + "_notclassified"); var eventId = ServerOperations.Events().CreateEvent(methodName + "_classified"); ServerOperations.Taxonomies().CreateHierarchicalTaxonomy("Custom"); ServerOperations.Taxonomies().CreateHierarchicalTaxon("parent", null, "Custom"); ServerOperations.Taxonomies().CreateHierarchicalTaxon("child", "parent", "Custom"); var taxonId = ServerOperations.Taxonomies().CreateHierarchicalTaxon(methodName, "child", "Custom"); ServerOperations.Events().AssignTaxonToEventItem(eventId, "Category", taxonId); try { var mvcProxy = new MvcControllerProxy(); mvcProxy.ControllerName = typeof(EventController).FullName; var eventController = new EventController(); eventController.Model.NarrowSelectionMode = Telerik.Sitefinity.Frontend.Mvc.Models.SelectionMode.FilteredItems; eventController.Model.SerializedNarrowSelectionFilters = this.GetNarrowSelectionSerializedQueryData("Category", "Category", methodName, taxonId); mvcProxy.Settings = new ControllerSettings(eventController); using (var generator = new PageContentGenerator()) { generator.CreatePageWithWidget(mvcProxy, null, methodName, methodName, methodName, 0); var pageContent = WebRequestHelper.GetPageWebContent(RouteHelper.GetAbsoluteUrl("~/" + methodName + "0")); Assert.Contains(pageContent, methodName + "_classified", System.StringComparison.Ordinal); Assert.DoesNotContain(pageContent, methodName + "_notclassified", System.StringComparison.Ordinal); } } finally { ServerOperations.Events().DeleteAllEvents(); ServerOperations.Taxonomies().DeleteCategories(methodName, "child", "parent"); ServerOperations.Taxonomies().DeleteHierarchicalTaxonomy("Custom"); } }
public void OnBeforeTestsStarts() { var templateId = ServerOperations.Templates().GetTemplateIdByTitle(TemplateTitle); Guid page1Id = ServerOperations.Pages().CreatePage(PageTitle, templateId); var page1NodeId = ServerOperations.Pages().GetPageNodeId(page1Id); ServerOperationsFeather.Pages().AddCalendarWidgetToPage(page1NodeId, PlaceHolderId); var basicCurrentEventStartTime = DateTime.Now; var currentEventStartTime = new DateTime(basicCurrentEventStartTime.Year, basicCurrentEventStartTime.Month, basicCurrentEventStartTime.Day, basicCurrentEventStartTime.Hour, basicCurrentEventStartTime.Minute, basicCurrentEventStartTime.Second); var basicCurrentEventEndTime = DateTime.Now.AddHours(1); var currentEventEndTime = new DateTime(basicCurrentEventEndTime.Year, basicCurrentEventEndTime.Month, basicCurrentEventEndTime.Day, basicCurrentEventEndTime.Hour, basicCurrentEventEndTime.Minute, basicCurrentEventEndTime.Second); ServerOperations.Events().CreateEvent(EventTitle, string.Empty, false, currentEventStartTime, currentEventEndTime); var currentEventItem = EventsManager.GetManager() .GetEvents() .Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == EventTitle) .FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("currentEventId", currentEventItem.Id.ToString()); }
public void OnBeforeTestsStarts() { var templateId = ServerOperations.Templates().CreateHybridMVCPageTemplate(CaptionCalendar); ServerOperations.Events().CreateCalendar(this.calendar1Guid, Calendar1Title); ServerOperations.Events().CreateEvent(Event1Title, string.Empty, IsAllDay, this.eventStart, this.eventEnd, this.calendar1Guid); var event1Item = EventsManager.GetManager() .GetEvents() .Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event1Title) .FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event1Id", event1Item.Id.ToString()); ServerOperations.Events().CreateCalendar(this.calendar2Guid, Calendar2Title); ServerOperations.Events().CreateEvent(Event2Title, string.Empty, IsAllDay, this.eventStart, this.eventEnd, this.calendar2Guid); var event2Item = EventsManager.GetManager() .GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == Event2Title) .FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("event2Id", event2Item.Id.ToString()); }
private void TestFilterByDate(string methodName, string serializedAdditionalFilters, IEnumerable <string> containedEvents, IEnumerable <string> notContainedEvents) { try { this.BuildEvents(methodName); var eventController = new EventController(); eventController.Model.DisplayMode = ListDisplayMode.Paging; eventController.Model.SelectionMode = SelectionMode.FilteredItems; eventController.Model.NarrowSelectionMode = SelectionMode.AllItems; eventController.Model.SerializedAdditionalFilters = serializedAdditionalFilters; var mvcProxy = new MvcControllerProxy() { Settings = new ControllerSettings(eventController), ControllerName = typeof(EventController).FullName }; using (var generator = new PageContentGenerator()) { generator.CreatePageWithWidget(mvcProxy, null, methodName, methodName, methodName, 0); var pageContent = WebRequestHelper.GetPageWebContent(RouteHelper.GetAbsoluteUrl("~/" + methodName + "0")); foreach (var title in containedEvents) { Assert.Contains(pageContent, title, StringComparison.Ordinal); } foreach (var title in notContainedEvents) { Assert.DoesNotContain(pageContent, title, StringComparison.Ordinal); } } } finally { ServerOperations.Events().DeleteAllEvents(); } }
public void OnAfterTestCompletes() { ServerOperations.Events().DeleteAllEvents(); ServerOperations.Templates().DeletePageTemplate(CaptionCalendar); }
public void OnAfterTestCompletes() { ServerOperations.Pages().DeleteAllPages(); ServerOperations.Events().DeleteAllEvents(); ServerOperations.Templates().DeletePageTemplate(TemplateName); }
public void OnAfterTestCompletes() { ServerOperations.Pages().DeleteAllPages(); ServerOperations.Events().DeleteAllEvents(); }
public void OnBeforeTestsStarts() { var templateId = ServerOperations.Templates().GetTemplateIdByTitle(TemplateTitle); Guid pageId = ServerOperations.Pages().CreatePage(PageTitle, templateId); var pageNodeId = ServerOperations.Pages().GetPageNodeId(pageId); ServerOperationsFeather.Pages().AddCalendarWidgetToPage(pageNodeId, PlaceHolderId); var basicCurrentEventStartTime = DateTime.Now; var currentEventStartTime = new DateTime(basicCurrentEventStartTime.Year, basicCurrentEventStartTime.Month, basicCurrentEventStartTime.Day, basicCurrentEventStartTime.Hour, basicCurrentEventStartTime.Minute, basicCurrentEventStartTime.Second); var basicCurrentEventEndTime = DateTime.Now.AddHours(1); var currentEventEndTime = new DateTime(basicCurrentEventEndTime.Year, basicCurrentEventEndTime.Month, basicCurrentEventEndTime.Day, basicCurrentEventEndTime.Hour, basicCurrentEventEndTime.Minute, basicCurrentEventEndTime.Second); ServerOperations.Events().CreateEvent(CurrentEventTitle, string.Empty, false, currentEventStartTime, currentEventEndTime); var currentEventExpectedStartTime = this.FormatTime(currentEventStartTime); var currentEventExpectedEndTime = this.FormatTime(currentEventEndTime); ServerArrangementContext.GetCurrent().Values.Add("currentEventStartTime", currentEventExpectedStartTime); ServerArrangementContext.GetCurrent().Values.Add("currentEventEndTime", currentEventExpectedEndTime); var currentEventItem = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == CurrentEventTitle).FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("currentEventId", currentEventItem.Id.ToString()); var basicBasePastInOneDayEventStartTime = DateTime.Now.AddDays(-1); var basePastInOneDayEventStartTime = new DateTime(basicBasePastInOneDayEventStartTime.Year, basicBasePastInOneDayEventStartTime.Month, basicBasePastInOneDayEventStartTime.Day, basicBasePastInOneDayEventStartTime.Hour, basicBasePastInOneDayEventStartTime.Minute, basicBasePastInOneDayEventStartTime.Second); var basicBasePastInOneDayEventEndTime = DateTime.Now.AddDays(-1); var basePastInOneDayEventEndTime = new DateTime(basicBasePastInOneDayEventEndTime.Year, basicBasePastInOneDayEventEndTime.Month, basicBasePastInOneDayEventEndTime.Day, basicBasePastInOneDayEventEndTime.Hour, basicBasePastInOneDayEventEndTime.Minute, basicBasePastInOneDayEventEndTime.Second); ServerOperations.Events().CreateEvent(BasePastInOneDayEventTitle, string.Empty, false, basePastInOneDayEventStartTime, basePastInOneDayEventEndTime); var basePastInOneDayEventExpectedStartTime = this.FormatTime(basePastInOneDayEventStartTime); var basePastInOneDayEventExpectedEndTime = this.FormatTime(basePastInOneDayEventEndTime); ServerArrangementContext.GetCurrent().Values.Add("basePastInOneDayEventStartTime", basePastInOneDayEventExpectedStartTime); ServerArrangementContext.GetCurrent().Values.Add("basePastInOneDayEventEndTime", basePastInOneDayEventExpectedEndTime); var pastEventItem = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == BasePastInOneDayEventTitle).FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("pastEventId", pastEventItem.Id.ToString()); var basicBaseUpcomingInOneDayEventStartTime = DateTime.Now.AddDays(1); var baseUpcomingInOneDayEventStartTime = new DateTime(basicBaseUpcomingInOneDayEventStartTime.Year, basicBaseUpcomingInOneDayEventStartTime.Month, basicBaseUpcomingInOneDayEventStartTime.Day, basicBaseUpcomingInOneDayEventStartTime.Hour, basicBaseUpcomingInOneDayEventStartTime.Minute, basicBaseUpcomingInOneDayEventStartTime.Second); var basicBaseUpcomingInOneDayEventEndTime = DateTime.Now.AddDays(1); var baseUpcomingInOneDayEventEndTime = new DateTime(basicBaseUpcomingInOneDayEventEndTime.Year, basicBaseUpcomingInOneDayEventEndTime.Month, basicBaseUpcomingInOneDayEventEndTime.Day, basicBaseUpcomingInOneDayEventEndTime.Hour, basicBaseUpcomingInOneDayEventEndTime.Minute, basicBaseUpcomingInOneDayEventEndTime.Second); ServerOperations.Events().CreateEvent(BaseUpcomingInOneDayEventTitle, string.Empty, false, baseUpcomingInOneDayEventStartTime, baseUpcomingInOneDayEventEndTime); var baseUpcomingInOneDayEventExpectedStartTime = this.FormatTime(baseUpcomingInOneDayEventStartTime); var baseUpcomingInOneDaytExpectedEndTime = this.FormatTime(baseUpcomingInOneDayEventEndTime); ServerArrangementContext.GetCurrent().Values.Add("baseUpcomingInOneDayEventStartTime", baseUpcomingInOneDayEventExpectedStartTime); ServerArrangementContext.GetCurrent().Values.Add("baseUpcomingInOneDayEventEndTime", baseUpcomingInOneDaytExpectedEndTime); var upcomingEventItem = EventsManager.GetManager().GetEvents().Where <Event>(ni => ni.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ni.Title == BaseUpcomingInOneDayEventTitle).FirstOrDefault(); ServerArrangementContext.GetCurrent().Values.Add("upcomingEventId", upcomingEventItem.Id.ToString()); ServerArrangementContext.GetCurrent().Values.Add("timezoneId", TimeZoneInfo.Utc.ToString()); }
public void TearDown() { ServerOperations.Events().DeleteAllEvents(); ServerOperations.Pages().DeleteAllPages(); }
public void TearDown() { ServerOperations.Pages().DeletePage(PageName); ServerOperations.Events().DeleteEvent(null, EventsTitle); }