-
Notifications
You must be signed in to change notification settings - Fork 142
Sleep api unit testing #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Async portable
Update Master Branch
2. Make modification to sort enum to keep casing consistent with api 3. Update the pagination object to use date time
…it.NET into SleepApiUnitTesting
Fitbit.Portable.Tests/SleepTests.cs
Outdated
| [TestFixture] | ||
| public class SleepTests | ||
| { | ||
| #region Success Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aarondcoleman are you a fan of using regions to break apart sections of code or would you rather not have these? i included them since the file was starting to get pretty big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amammay Not a fan of the region personally. We probably need to look at refactoring the tests if the files are getting big
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understandable, i can remove the regions this evening, better off having things consistent also
|
|
||
| var responseMessage = new Func<HttpResponseMessage>(() => | ||
| { | ||
| return new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(content) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to remove the spaces; inconsistent with below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted
| { | ||
| public enum SortEnum | ||
| { | ||
| Asc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have these been made lowercase? This is not standard in naming of enum values, nor are the values used as the string representation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not really sure why i did this, will change it back.
| public class Pagination | ||
| { | ||
| public string BeforeDate { get; set; } | ||
| public DateTime BeforeDate { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they always serialize / parse into DateTimes? As long as they do, this is a good change 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we are pretty consistent on the library level of parsing into a DateTime object. And after taking a peek at the web api reference it seems to be as a date time object as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
2. Revert Sort Enum back to proper casing.
|
@WestDiscGolf changes have been made. |
Updated unit testing in regards to the sleep api.