Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Implemented downloading features #155

Merged
merged 6 commits into from
Apr 7, 2022
Merged

Implemented downloading features #155

merged 6 commits into from
Apr 7, 2022

Conversation

Tsathogguaa
Copy link
Collaborator

@Tsathogguaa Tsathogguaa commented Apr 7, 2022

image
image
image

Implemented the ability to download song extracts, acquired from the iTunes API.

Copy link
Owner

@MaximeZmt MaximeZmt left a comment

Choose a reason for hiding this comment

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

Nice works 👍 , just some small easy changes that can be done now

Comment on lines 25 to 26

class DownloadActivity : AppCompatActivity() {
Copy link
Owner

Choose a reason for hiding this comment

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

Should add documentations

Copy link
Owner

Choose a reason for hiding this comment

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

for all public methods of class (except override)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

Comment on lines +42 to +45
fun switchToDownload(view: View) {
sendDirectIntent(DownloadActivity::class.java)
}

Copy link
Owner

Choose a reason for hiding this comment

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

Should be easy to test, currently untested

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

onView(withId(R.id.download_songName)).perform(typeText(songName), closeSoftKeyboard())
Thread.sleep(100)
onView(withId(R.id.download_downloadsong)).perform(click())
Thread.sleep(2000)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try using constants for the Thread.sleep calls instead of hardcoded values.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

if(extract.exists()) {
assert(false)
} else {
assert(true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Simpler to use assert(extract.exists()) here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, for that one it's assert(!extract.exists()) due to it being a negative assumption. Otherwise you are correct, thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

Copy link
Collaborator

@zwierski zwierski left a comment

Choose a reason for hiding this comment

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

The code looks good to me, there are just some minor issues to be refactored in the tests (see comments).

@codeclimate
Copy link

codeclimate bot commented Apr 7, 2022

Code Climate has analyzed commit 6c9bebf and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 83.9% (80% is the threshold).

This pull request will bring the total coverage in the repository to 91.1% (-0.5% change).

View more on Code Climate.

Copy link
Owner

@MaximeZmt MaximeZmt left a comment

Choose a reason for hiding this comment

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

Top 👍

@Tsathogguaa Tsathogguaa merged commit 3397bc2 into main Apr 7, 2022
@Tsathogguaa Tsathogguaa deleted the tsathogguaa/download branch April 7, 2022 16:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants