public void exhibit_should_allow_pdf_content_item_adding() { Logger.Log("Bug: https://github.com/alterm4nn/ChronoZoom/issues/526", LogType.Debug); var contentItemPdf = new ContentItem { Title = "ContentItemPdf", Caption = "This is pdf", MediaSource = "http://ads.ccsd.cnrs.fr/docs/00/10/47/81/PDF/p85_89_vol3483m.pdf", MediaType = "PDF", Attribution = "Tests Attribution", Uri = "http://ads.ccsd.cnrs.fr/docs/00/10/47/81/PDF/p85_89_vol3483m.pdf" }; var exhibit = new Exhibit { Title = "WebdriverExhibitWithContent", ContentItems = new Collection<ContentItem> { contentItemPdf } }; ExhibitHelper.AddExhibitWithContentItem(exhibit); _newExhibit = ExhibitHelper.GetNewExhibit(); Assert.AreEqual(exhibit.ContentItems.Count, _newExhibit.ContentItems.Count, "Content items count are not equal"); for (int i = 0; i < exhibit.ContentItems.Count; i++) { Assert.AreEqual(exhibit.ContentItems[i].Title, _newExhibit.ContentItems[i].Title, "Content items titles are not equal"); Assert.AreEqual(exhibit.ContentItems[i].MediaType, _newExhibit.ContentItems[i].MediaType, true, "Content items mediaTypes are not equal"); Assert.AreEqual(contentItemPdf.Uri, _newExhibit.ContentItems[i].Uri, "Content items Uri are not equal"); } }
private void FillArtifact(Chronozoom.Entities.ContentItem contentItem) { Logger.Log("<- contentItem: " + contentItem); if (contentItem.Title != null) { SetTitle(contentItem.Title); } if (contentItem.Caption != null) { SetDescription(contentItem.Caption); } if (contentItem.Uri != null) { SetUrl(contentItem.Uri); } if (contentItem.MediaType != null) { SelectMediaType(contentItem.MediaType); } if (contentItem.Attribution != null) { SetAttribution(contentItem.Attribution); } if (contentItem.MediaSource != null) { SetMediaSourse(contentItem.MediaSource); } Logger.Log("->"); }
public void TestInitialize() { BrowserStateManager.RefreshState(); HomePageHelper.OpenSandboxPage(); //HomePageHelper.DeleteAllElementsLocally(); TourHelper.DeleteToursIfExist("webdriverTour"); #region create timeline _newTimeline = new Timeline { FromYear = -6061670000, ToYear = -5808809999, Title = "WebDriverApiTitle" }; Guid newTimelineId = ApiHelper.CreateTimelineByApi(_newTimeline); _newTimeline.Id = newTimelineId; #endregion #region create exhibit var contentItems = new Collection <ContentItem>(); var contentItem = new ContentItem() { Title = "WebDriverApi", MediaType = "image", Uri = @"http://yandex.st/www/1.609/yaru/i/logo.png", Caption = "", Order = 0, Attribution = "", MediaSource = "" }; contentItems.Add(contentItem); _newExhibit = new Exhibit() { Timeline_ID = newTimelineId, Title = "WebDriverApiExhibit", Year = -8596430000, ContentItems = contentItems }; _newExhibit.Id = new Guid(ApiHelper.CreateExhibitByApi(_newExhibit).ExhibitId); #endregion #region init new tour _newTour = new Tour(); _newTour.Name = "webdriverTour"; _newTour.Description = "webdriver description"; Bookmark exhibitBookmark = new Bookmark { Name = "WebDriverApiExhibitBookmark", Id = _newExhibit.Id, Type = "exhibit" }; Bookmark timelineBookmark = new Bookmark { Name = "WebDriverApiTimelineBookmark", Id = _newTimeline.Id, Type = "timeline" }; Collection <Chronozoom.Entities.Bookmark> bookmarks = new Collection <Chronozoom.Entities.Bookmark> { exhibitBookmark, timelineBookmark }; _newTour.Bookmarks = bookmarks; #endregion HomePageHelper.OpenSandboxPage(); }
public void exhibit_should_allow_pdf_content_item_adding() { Logger.Log("Bug: https://github.com/alterm4nn/ChronoZoom/issues/526", LogType.Debug); var contentItemPdf = new ContentItem { Title = "ContentItemPdf", Caption = "This is pdf", MediaSource = "http://ads.ccsd.cnrs.fr/docs/00/10/47/81/PDF/p85_89_vol3483m.pdf", MediaType = "PDF", Attribution = "Tests Attribution", Uri = "http://ads.ccsd.cnrs.fr/docs/00/10/47/81/PDF/p85_89_vol3483m.pdf" }; var exhibit = new Exhibit { Title = "WebdriverExhibitWithContent", ContentItems = new Collection <ContentItem> { contentItemPdf } }; ExhibitHelper.AddExhibitWithContentItem(exhibit); _newExhibit = ExhibitHelper.GetNewExhibit(); Assert.AreEqual(exhibit.ContentItems.Count, _newExhibit.ContentItems.Count, "Content items count are not equal"); for (int i = 0; i < exhibit.ContentItems.Count; i++) { Assert.AreEqual(exhibit.ContentItems[i].Title, _newExhibit.ContentItems[i].Title, "Content items titles are not equal"); Assert.AreEqual(exhibit.ContentItems[i].MediaType, _newExhibit.ContentItems[i].MediaType, true, "Content items mediaTypes are not equal"); Assert.AreEqual(contentItemPdf.Uri, _newExhibit.ContentItems[i].Uri, "Content items Uri are not equal"); } }
public void TestInitialize() { BrowserStateManager.RefreshState(); HomePageHelper.OpenSandboxPage(); TourHelper.DeleteToursIfExist("webdriverTour"); #region create timeline _newTimeline = new Timeline { FromYear = -6061670000, ToYear = -5808809999, Title = "WebDriverApiTitle" }; Guid newTimelineId = ApiHelper.CreateTimelineByApi(_newTimeline); _newTimeline.Id = newTimelineId; #endregion #region create exhibit var contentItems = new Collection<ContentItem>(); var contentItem = new ContentItem() { Title = "WebDriverApi", MediaType = "image", Uri = @"http://yandex.st/www/1.609/yaru/i/logo.png", Caption = "", Order = 0, Attribution = "", MediaSource = "" }; contentItems.Add(contentItem); _newExhibit = new Exhibit() { Timeline_ID = newTimelineId, Title = "WebDriverApiExhibit", Year = -8596430000, ContentItems = contentItems }; _newExhibit.Id = new Guid(ApiHelper.CreateExhibitByApi(_newExhibit).ExhibitId); #endregion #region init new tour _newTour = new Tour(); _newTour.Name = "webdriverTour"; _newTour.Description = "webdriver description"; Bookmark exhibitBookmark = new Bookmark { Name = "WebDriverApiExhibitBookmark", Id = _newExhibit.Id, Type = "exhibit" }; Bookmark timelineBookmark = new Bookmark { Name = "WebDriverApiTimelineBookmark", Id = _newTimeline.Id, Type = "timeline" }; Collection<Chronozoom.Entities.Bookmark> bookmarks = new Collection<Chronozoom.Entities.Bookmark> { exhibitBookmark, timelineBookmark }; _newTour.Bookmarks = bookmarks; #endregion HomePageHelper.OpenSandboxPage(); }
public void TestInitialize() { BrowserStateManager.RefreshState(); #region create exhibit var contentItems = new Collection<ContentItem>(); var contentItem = new ContentItem { Title = "WebDriverApi", MediaType = "image", Uri = @"http://yandex.st/www/1.609/yaru/i/logo.png", Caption = "", Order = 0, Attribution = "AttributionApI", MediaSource = "https://trello.com/board/development/510a91105420848638003cda" }; contentItems.Add(contentItem); _newExhibit = new Exhibit { Timeline_ID = new Guid("bdc1ceff-76f8-4df4-ba72-96b353991314"), Title = "WebDriverApiExhibitAlexey", Year = -8596430000, ContentItems = contentItems }; ApiHelper.CreateExhibitByApi(_newExhibit); #endregion HomePageHelper.OpenSandboxPage(); }
public void exhibit_should_display_correct_date_december_in_bce() { var contentItemPdf = new ContentItem { Title = RandomString.GetRandomString(1, 200), Caption = RandomString.GetRandomString(1, 200), MediaSource = RandomUrl.GetRandomWebUrl(), MediaType = "image", Attribution = RandomString.GetRandomString(1, 200), Uri = RandomUrl.GetRandomImageUrl(), Order = 0 }; const decimal year = -2015; _newExhibit = new Exhibit { Title = RandomString.GetRandomString(1, 200), ContentItems = new Collection <ContentItem> { contentItemPdf }, Month = "December", Day = "31", Year = ExhibitHelper.GetCoordinateFromYmd(year, 12, 31), Timeline_ID = new Guid("bdc1ceff-76f8-4df4-ba72-96b353991314") }; ApiHelper.CreateExhibitByApi(_newExhibit); HomePageHelper.OpenSandboxPage(); ExhibitHelper.NavigateToExhibit(_newExhibit); string displayDate = ExhibitHelper.GetExhibitDisplayDate(_newExhibit); StringAssert.Contains(displayDate, "BCE"); StringAssert.Contains(displayDate, year.ToString(CultureInfo.InvariantCulture)); StringAssert.Contains(displayDate, _newExhibit.Day); if (GitHubIssueWatcher.IssueStatus.IsIssueResolved("1024")) { StringAssert.Contains(displayDate, DateTime.ParseExact(_newExhibit.Month, "MMMM", CultureInfo.InvariantCulture).Month.ToString(CultureInfo.InvariantCulture)); } }
public void TestInitialize() { BrowserStateManager.RefreshState(); #region create exhibit var contentItems = new Collection <ContentItem>(); var contentItem = new ContentItem { Title = "WebDriverApi", MediaType = "image", Uri = @"http://yandex.st/www/1.609/yaru/i/logo.png", Caption = "", Order = 0, Attribution = "AttributionApI", MediaSource = "https://trello.com/board/development/510a91105420848638003cda" }; contentItems.Add(contentItem); _newExhibit = new Exhibit { Timeline_ID = new Guid("bdc1ceff-76f8-4df4-ba72-96b353991314"), Title = "WebDriverApiExhibitAlexey", Year = -8596430000, ContentItems = contentItems }; _newExhibit.Id = new Guid(ApiHelper.CreateExhibitByApi(_newExhibit).ExhibitId); #endregion HomePageHelper.OpenSandboxPage(); }
public void exhibit_should_allow_two_content_items_adding() { var contentItemImage = new ContentItem { Title = "ContentItemImage", MediaType = "Image", Uri = "http://i.telegraph.co.uk/multimedia/archive/02429/eleanor_scriven_2429776k.jpg", Attribution = "Image", Caption = "Description" }; var contentItemMusic = new ContentItem { Title = "ContentItemMusic", MediaType = "Image", Uri = "http://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Aeroflot_Airbus_A330_Kustov_edit.jpg/800px-Aeroflot_Airbus_A330_Kustov_edit.jpg", Attribution = "Image2", Caption = "Description2" }; var exhibit = new Exhibit { Title = "WebdriverExhibitWithContent", ContentItems = new Collection <ContentItem> { contentItemImage, contentItemMusic } }; ExhibitHelper.AddExhibitWithContentItem(exhibit); _newExhibit = ExhibitHelper.GetNewExhibit(); Assert.AreEqual(exhibit.ContentItems.Count, _newExhibit.ContentItems.Count, "Content items count are not equal"); for (int i = 0; i < exhibit.ContentItems.Count; i++) { Assert.AreEqual(exhibit.ContentItems[i].Title, _newExhibit.ContentItems[i].Title, "Content items titles are not equal"); Assert.AreEqual(exhibit.ContentItems[i].MediaType, _newExhibit.ContentItems[i].MediaType, true, "Content items mediaTypes are not equal"); Assert.AreEqual(exhibit.ContentItems[i].Uri, _newExhibit.ContentItems[i].Uri, "Content items Uri are not equal"); } }
public void exhibit_should_allow_two_content_items_adding() { var contentItemImage = new ContentItem { Title = "ContentItemImage", MediaType = "Image", Uri = "http://i.telegraph.co.uk/multimedia/archive/02429/eleanor_scriven_2429776k.jpg", Attribution = "Image", Caption = "Description" }; var contentItemMusic = new ContentItem { Title = "ContentItemMusic", MediaType = "Image", Uri = "http://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Aeroflot_Airbus_A330_Kustov_edit.jpg/800px-Aeroflot_Airbus_A330_Kustov_edit.jpg", Attribution = "Image2", Caption = "Description2" }; var exhibit = new Exhibit { Title = "WebdriverExhibitWithContent", ContentItems = new Collection<ContentItem> { contentItemImage, contentItemMusic } }; ExhibitHelper.AddExhibitWithContentItem(exhibit); _newExhibit = ExhibitHelper.GetNewExhibit(); Assert.AreEqual(exhibit.ContentItems.Count, _newExhibit.ContentItems.Count, "Content items count are not equal"); for (int i = 0; i < exhibit.ContentItems.Count; i++) { Assert.AreEqual(exhibit.ContentItems[i].Title, _newExhibit.ContentItems[i].Title, "Content items titles are not equal"); Assert.AreEqual(exhibit.ContentItems[i].MediaType, _newExhibit.ContentItems[i].MediaType, true, "Content items mediaTypes are not equal"); Assert.AreEqual(exhibit.ContentItems[i].Uri, _newExhibit.ContentItems[i].Uri, "Content items Uri are not equal"); } }
public void exhibit_should_display_correct_date_in_ce() { var contentItemPdf = new ContentItem { Title = RandomString.GetRandomString(1, 200), Caption = RandomString.GetRandomString(1, 200), MediaSource = RandomUrl.GetRandomWebUrl(), MediaType = "pdf", Attribution = RandomString.GetRandomString(1, 200), Uri = RandomUrl.GetRandomPdfUrl(), Order = 0 }; CustomDate date = RandomDate.GetRandomDate(1900); _newExhibit = new Exhibit { Title = RandomString.GetRandomString(1, 200), ContentItems = new Collection<ContentItem> { contentItemPdf }, Month = date.MonthName, Day = date.Day.ToString(CultureInfo.InvariantCulture), Year = ExhibitHelper.GetCoordinateFromYmd(date.Year, date.MonthNumber, date.Day), Timeline_ID = new Guid("bdc1ceff-76f8-4df4-ba72-96b353991314") }; ApiHelper.CreateExhibitByApi(_newExhibit); HomePageHelper.OpenSandboxPage(); ExhibitHelper.NavigateToExhibit(_newExhibit); string displayDate = ExhibitHelper.GetExhibitDisplayDate(_newExhibit); StringAssert.Contains(displayDate, "CE"); StringAssert.Contains(displayDate, date.Year.ToString(CultureInfo.InvariantCulture)); StringAssert.Contains(displayDate, _newExhibit.Day); if (GitHubIssueWatcher.IssueStatus.IsIssueResolved("1024")) { StringAssert.Contains(displayDate, DateTime.ParseExact(_newExhibit.Month, "MMMM", CultureInfo.InvariantCulture).Month.ToString(CultureInfo.InvariantCulture)); } }