-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
@@ -153,8 +153,8 @@ class LyricsBelongGameActivityTest { | |||
scn.onActivity { activity -> | |||
activity.testGetAndCheckLyrics("the best song in the world", "Mr.Mystery", "", gameManager) | |||
} | |||
Thread.sleep(sleepTime) | |||
onView(withId(R.id.lyricMatchResult)).check(matches(withText("No lyrics found, try another song"))) | |||
// Thread.sleep(10000) |
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.
Maybe delete these if they're unecessary
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.
Sometime tests are not working because of the timing issue. I dont want to remove them so we remember to modify them
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.
In this case, you can add a @fixme. I will try to mock the API call once the mock library is set up.
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.
Done!
* @param | ||
* n: number of players selected in the spinner | ||
* id: the id of the field to update | ||
* Fetch data from Lastfm and set song list in a GameManager |
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.
maybe add an explanation what the parameter uri is in the javadoc
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.
Vey good job, just some very minor details but I'd even without them LGTM
switchToGame(TypingGameActivity()) | ||
} | ||
else if(this.game == "local_lyrics"){ | ||
switchToGame(LyricsBelongGameActivity()) |
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.
Is it normal that the lyrics game is not tested?
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 have the tests for it:
fun localTypingOnClick(){
onView(withId(R.id.local_typing_game_button)).perform(scrollTo(), click())
onView(withId(R.id.btsButton)).perform(click())
onView(withId(R.id.difficulty_spinner)).perform(click())
intended(hasComponent(TypingGameActivity::class.java.name))
intended(hasExtra("Difficulty", "Hard"))
}
I have tested for random difficulty and genre. Do you think it is enough?
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.
Ahh, this one I am not... I will test it!
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.
Done!
app/src/main/java/ch/sdp/vibester/activity/GameSetupActivity.kt
Outdated
Show resolved
Hide resolved
@@ -153,8 +153,8 @@ class LyricsBelongGameActivityTest { | |||
scn.onActivity { activity -> | |||
activity.testGetAndCheckLyrics("the best song in the world", "Mr.Mystery", "", gameManager) | |||
} | |||
Thread.sleep(sleepTime) | |||
onView(withId(R.id.lyricMatchResult)).check(matches(withText("No lyrics found, try another song"))) | |||
// Thread.sleep(10000) |
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.
In this case, you can add a @fixme. I will try to mock the API call once the mock library is set up.
|
||
/** | ||
* Converts the spinner text for the number of players into an Int | ||
* @param |
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.
* @param | |
* @param text: the string to be converted |
app/src/main/java/ch/sdp/vibester/activity/BuzzerSetupActivity.kt
Outdated
Show resolved
Hide resolved
"Three" -> return 3 | ||
"Four" -> return 4 | ||
} | ||
return 1 |
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.
Is it possible to test the return value?
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.
This was not my code, but I will try!
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.
Done!
Co-authored-by: jiabaow <[email protected]>
Co-authored-by: jiabaow <[email protected]>
|
||
val statNames: ArrayList<String> = mockArray | ||
|
||
val statVal: ArrayList<String> = mockArray |
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.
Good change, makes more sense to have all the tests values in variables.
val updater = BuzzerScoreUpdater(buzIds, allPoints) | ||
|
||
val buzToScoreMap = fetchBuzToScoreRowMap() | ||
val updater = BuzzerScoreUpdater(buzIds, arrayListOf(*allPoints)) | ||
|
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.
Maybe change the declaration of allPoints to an ArrayList if possible, it might be simpler than declaring an array and then casting it.
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.
Fixed!
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.
Good job on refactoring so much code! Everything looks good to me, there is one change I commented on (the array declaration) but I can take care of it since it's part of the code I've written.
Code Climate has analyzed commit 103db5d and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 96.1% (80% is the threshold). This pull request will bring the total coverage in the repository to 92.4% (1.5% change). View more on Code Climate. |
This PR rewrites the logic of settings for any game and connects Typing Game to the welcome screen. Now every game has the following common settings: choosing genre and choosing difficulty. After the settings are set up, the individual game activities will start.
Major changes: