public async Task should_get_event_details() { var request = new EventListRequest(); request.Lang = "ru"; var fieldBuilder = new FieldsBuilder(); request.Fields = fieldBuilder.WithField(EventListRequest.FieldNames.ID).Build(); request.ActualSince = DateTime.Today; request.Location = Location.Spb; //then var res = await request.ExecuteAsync(); var first = res.Results.First(); var detailsRequest = new EventDetailsRequest(); detailsRequest.EventId = first.Id; var actual = await detailsRequest.ExecuteAsync(); Assert.IsNotNull(actual); Assert.AreEqual(actual.Id, first.Id); }
public async Task should_throw_exception() { var detailsRequest = new EventDetailsRequest(); detailsRequest.Lang = "ru"; detailsRequest.EventId = 10000000000000000; var actual = await detailsRequest.ExecuteAsync(); }
public async Task <IEventDetailsResponse> GetEventDetails(long eventId) { var request = new EventDetailsRequest(); request.Lang = _culture; request.EventId = eventId; request.TextFormat = TextFormatEnum.Plain; request.Expand = EventListRequest.ExpandNames.PLACE + "," + EventListRequest.ExpandNames.IMAGES; var res = await request.ExecuteAsync(); return(res); }
private async Task LoadEventOfTheDay() { var request = new EventsOfTheDayRequest(); request.TextFormat = TextFormatEnum.Text; request.Location = Location.Spb; var res = await request.ExecuteAsync(); var eventOfTheDay = res.Results.First().Event; var details = new EventDetailsRequest(); details.EventId = eventOfTheDay.Id; var detailsRes = await details.ExecuteAsync(); //var place = new PlaceRequest(); //TODO EventOfTheDay = new EventViewModel(eventOfTheDay.FirstImage.Thumbnail.Small, eventOfTheDay.Title, null); OnPropertyChanged("EventOfTheDay"); }