public async Task should_get_events_of_the_day()
        {
            var request = new EventsOfTheDayRequest();

            request.Lang     = "ru";
            request.Location = Location.Spb;

            //then
            var res = await request.ExecuteAsync();

            var first = res.Results.First();

            Assert.IsNotNull(first);
        }
Exemplo n.º 2
0
        public async Task <IEventsOfTheDayResponse> GetEventOfTheDay(string next)
        {
            var request = new EventsOfTheDayRequest();

            request.Lang       = _culture;
            request.TextFormat = TextFormatEnum.Plain;
            request.Next       = next;

            var fieldBuilder = new FieldsBuilder();

            request.Fields = fieldBuilder
                             .WithField(EventsOfTheDayRequest.FieldsNames.DATE)
                             .WithField(EventsOfTheDayRequest.FieldsNames.EVENT)
                             .WithField(EventsOfTheDayRequest.FieldsNames.LOCATION)
                             .Build();
            request.Location = _location;

            var res = await request.ExecuteAsync();

            return(res);
        }
Exemplo n.º 3
0
        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");
        }