Example #1
0
        public void DeleteTourByApi(Tour tour)
        {
            DataContractJsonSerializer tourSerializer = new DataContractJsonSerializer(typeof(Tour));
            HttpWebRequest             request        = MakeDeleteRequest(TourApiServiceUrl);
            Stream requestStream = request.GetRequestStream();

            tourSerializer.WriteObject(requestStream, tour);
            request.GetResponse();
        }
Example #2
0
        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();
        }
Example #3
0
 public void DeleteTourByApi(Tour tour)
 {
     DataContractJsonSerializer tourSerializer = new DataContractJsonSerializer(typeof(Tour));
     HttpWebRequest request = MakeDeleteRequest(TourApiServiceUrl);
     Stream requestStream = request.GetRequestStream();
     tourSerializer.WriteObject(requestStream, tour);
     request.GetResponse();
 }