public async Task <List <AthleteSummary> > GetBothFollowingAsync(string athleteId) { string getUrl = string.Format("{0}/{1}/both-following?access_token={2}", "https://www.strava.com/api/v3/athletes", athleteId, Authentication.AccessToken); return(Unmarshaller <List <AthleteSummary> > .Unmarshal(await WebRequest.SendGetAsync(new Uri(getUrl)))); }
private async Task <Stats> GetStatsAsync(string id) { string getUrl = $"https://www.strava.com/api/v3/athletes/{id}/stats?access_token={Authentication.AccessToken}"; return(Unmarshaller <Stats> .Unmarshal(await WebRequest.SendGetAsync(new Uri(getUrl)))); }
public void TestBikeUnmarshalling() { Gear.Bike bike = Unmarshaller <Gear.Bike> .Unmarshal(_json); Assert.IsNotNull(bike); }
public static List <double> DeserializeList(String key, Deserializer deserializer) { Unmarshaller unmarshaller = new Unmarshaller(deserializer.Get(key)); return(new List <double>(unmarshaller.UnmarshallArrayOfDouble())); }
public void TestCommentsCount() { List <Comment> comments = Unmarshaller <List <Comment> > .Unmarshal(_json); Assert.IsTrue(comments.Count == 3); }
/** * Constructs a new KS3 response handler that will use the specified SAX * unmarshaller to turn the response into an object. */ public XmlResponseHandler(Unmarshaller <X, Stream> responseUnmarshaller) { this.responseUnmarshaller = responseUnmarshaller; }
public void TestBikeWeight() { List <ActivityZone> zone = Unmarshaller <List <ActivityZone> > .Unmarshal(_json); Assert.IsTrue(zone.ElementAt(1).BikeWeight > 0); }
public void TestBikeUnmarshallingFrameType() { Gear.Bike bike = Unmarshaller <Gear.Bike> .Unmarshal(_json); Assert.IsTrue(bike.FrameType == BikeType.Road); }
public void TestBikeUnmarshallingDescription() { Gear.Bike bike = Unmarshaller <Gear.Bike> .Unmarshal(_json); Assert.IsTrue(bike.Description.Equals(String.Empty)); }
public void TestBikeUnmarshallingId() { Gear.Bike bike = Unmarshaller <Gear.Bike> .Unmarshal(_json); Assert.IsTrue(bike.Id.Equals("b814946")); }
public void TestBikeUnmarshallingPrimary() { Gear.Bike bike = Unmarshaller <Gear.Bike> .Unmarshal(_json); Assert.IsTrue(bike.IsPrimary); }
public void TestBikeUnmarshallingModel() { Gear.Bike bike = Unmarshaller <Gear.Bike> .Unmarshal(_json); Assert.IsTrue(bike.Model.Equals("Roadlite AL 7.0")); }
public void TestBikeUnmarshallingBrand() { Gear.Bike bike = Unmarshaller <Gear.Bike> .Unmarshal(_json); Assert.IsTrue(bike.Brand.Equals("Canyon")); }
public void TestBikeUnmarshallingName() { Gear.Bike bike = Unmarshaller <Gear.Bike> .Unmarshal(_json); Assert.IsTrue(bike.Name.Equals("Canyon Roadlite AL 7.0")); }
public async Task <Athlete> UpdateAthleteSex(Gender gender) { string putUrl = string.Format("{0}?sex={1}&access_token={2}", "https://www.strava.com/api/v3/athlete", gender.ToString().Substring(0, 1), Authentication.AccessToken); return(Unmarshaller <Athlete> .Unmarshal(await WebRequest.SendPutAsync(new Uri(putUrl)))); }
public virtual void afterUnmarshal(Unmarshaller unmarshaller, object parent) { this.target++; }
public async Task <Bike> GetGearAsync(string gearId) { string getUrl = string.Format("{0}/{1}?access_token={2}", "https://www.strava.com/api/v3/gear", gearId, Authentication.AccessToken); return(Unmarshaller <Bike> .Unmarshal(await WebRequest.SendGetAsync(new Uri(getUrl)))); }
public CallbackReceiverAdapter(Unmarshaller unmarshaller, Action action) { _unmarshaller = unmarshaller; _action = action; }
public void TestHeartRateMax() { List <ActivityZone> zone = Unmarshaller <List <ActivityZone> > .Unmarshal(_json); Assert.IsTrue(zone.ElementAt(0).Max.Equals(196)); }
public void TestAthleteUnmarshalling() { Athlete athlete = Unmarshaller <Athlete> .Unmarshal(_json); Assert.IsNotNull(athlete); }
public void TestBucketSizes() { List <ActivityZone> zone = Unmarshaller <List <ActivityZone> > .Unmarshal(_json); Assert.IsTrue(zone.ElementAt(0).Buckets.Count == 5 && zone.ElementAt(1).Buckets.Count == 11); }
public async Task <List <SegmentEffort> > GetSegmentEffortsByAthleteAsync(string segmentId, string athleteId, int page, int perPage) { string getUrl = string.Format("{0}/{1}/all_efforts?athlete_id={2}&page={3}&per_page={4}&access_token={5}", "https://www.strava.com/api/v3/segments", segmentId, athleteId, page, perPage, Authentication.AccessToken); return(Unmarshaller <List <SegmentEffort> > .Unmarshal(await WebRequest.SendGetAsync(new Uri(getUrl)))); }
public void TestCommentsUnmarshalling() { List <Comment> comments = Unmarshaller <List <Comment> > .Unmarshal(_json); Assert.IsNotNull(comments); }
public async Task <List <SegmentEffort> > GetSegmentEffortsAsync(string segmentId, string athleteId, DateTime after, DateTime before, int page, int perPage) { string getUrl = string.Format("{0}/{1}/all_efforts?athlete_id={2}&start_date_local={3}&end_date_local={4}&page={5}per_page={6}&access_token={7}", "https://www.strava.com/api/v3/segments", segmentId, athleteId, after.ToString("O"), before.ToString("O"), page, perPage, Authentication.AccessToken); return(Unmarshaller <List <SegmentEffort> > .Unmarshal(await WebRequest.SendGetAsync(new Uri(getUrl)))); }
public void TestPhotoUnmarshalling() { Photo photo = Unmarshaller <Photo> .Unmarshal(_json); Assert.IsNotNull(photo); }
public async Task <List <AthleteSummary> > GetFollowersAsync() { string getUrl = string.Format("{0}?access_token={1}", "https://www.strava.com/api/v3/athlete/followers", Authentication.AccessToken); return(Unmarshaller <List <AthleteSummary> > .Unmarshal(await WebRequest.SendGetAsync(new Uri(getUrl)))); }
public void TestActivityZoneUnmarshalling() { List <ActivityZone> zone = Unmarshaller <List <ActivityZone> > .Unmarshal(_json); Assert.IsNotNull(zone); }
public async Task <UploadStatus> CheckUploadStatusAsync(string uploadId) { string checkUrl = string.Format("{0}/{1}?access_token={2}", "https://www.strava.com/api/v3/uploads/", uploadId, Authentication.AccessToken); return(Unmarshaller <UploadStatus> .Unmarshal(await WebRequest.SendGetAsync(new Uri(checkUrl)))); }