Skip to content

Conversation

@dwaynefitabase
Copy link
Contributor

FIxes #228

An extension of the changes from Redmorello

redmorello and others added 30 commits March 10, 2017 12:35
Copy link
Contributor

@WestDiscGolf WestDiscGolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think there may have been a couple of items missed from the original pull request which need tweaking.

public Fixture fixture { get; set; }

[TestFixtureSetUp]
[OneTimeSetUp]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New one on me :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our CI build agents didn't like TestFixtureSetUp used with V3 of the test framework ;-|

<None Include="SampleData\ApiSubscriptionNotification.json" />
<None Include="SampleData\GetActivities.json" />
<None Include="SampleData\GetHeartRateTimeSeries.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be different from the others?

</None>
<None Include="SampleData\GetHeartRateIntradayTimeSeries.json" />
<None Include="SampleData\GetActivityLogsList.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above? need to be different?

Task<ApiSubscription> AddSubscriptionAsync(APICollectionType apiCollectionType, string uniqueSubscriptionId, string subscriberId = default(string));
Task DeleteSubscriptionAsync(APICollectionType collection, string uniqueSubscriptionId, string subscriberId = null);
Task<ActivityLog> LogActivityAsync(ActivityLog model);
Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetHeartRateTimeSeriesAsync to keep with the pattern

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetHeartRateTimeSeries is the name used in current versions. RedMorello updated it, but this is a braking change so we're gonna keep it the same for now.

public async Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = null)

Task DeleteSubscriptionAsync(APICollectionType collection, string uniqueSubscriptionId, string subscriberId = null);
Task<ActivityLog> LogActivityAsync(ActivityLog model);
Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-");
Task<HeartActivitiesIntraday> GetHeartRateIntraday(DateTime date, HeartRateResolution resolution, string userId = "-");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetHeartRateIntradayAsync to keep with the pattern

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public async Task<HeartActivitiesIntraday> GetHeartRateIntraday(DateTime date, HeartRateResolution resolution)

public int Value { get; set; }
}

public class IntradayActivitiesHeart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All classes should be in their own files :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

[JsonProperty(PropertyName = "activities-heart-intraday")]
public ActivitesHeartIntraday ActivitiesHeartIntraday { get; set; }
}
public class ActivitesHeart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All classes should be in their own files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

public async Task<List<ActivityLogsList>> GetActivityLogsList(DateTime? beforeDate, DateTime? afterDate, int limit = 20, string encodedUserId = default(string))
{
var apiCall = string.Empty;
limit = limit > 20 ? 20 : limit;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the check for negative values as per the original code review / pull request

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

return (new JsonDotNetSerializer() { RootProperty = "activities" }).Deserialize<List<ActivityLogsList>>(responseBody);
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace not needed between methods

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

/// <returns></returns>
public async Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-")
{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace not needed in methods

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Owner

@aarondcoleman aarondcoleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@aarondcoleman aarondcoleman merged commit 0fdb2a0 into master Sep 14, 2017
@aarondcoleman aarondcoleman deleted the issue228-CleanupActivityChanges branch September 14, 2017 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants