Mocking lab#12
Conversation
|
Omoremi, I'm not sure if you followed my instructions to view your PR while/after creating it in GitHub. There are 48 changed files. There should be only a few. You can fix this by As always, let me know if you don't understand my instructions. |
ellenspertus
left a comment
There was a problem hiding this comment.
You can improve this through Tuesday, Dec. 22.
| ObservableList<WordRecord> testListRecord = FXCollections.observableList(testList); | ||
| SampleData.addWordOfTheDay(testListRecord, mockWordsApi, mockWordApi); | ||
|
|
||
| WordOfTheDay wordToday = SampleData.getWordOfTheDay(mockWordsApi); |
There was a problem hiding this comment.
Don't call getWordOfTheDay() in this test. You are testing addWordOfTheDay(). Only use that. Base your assertions on the WordRecord that is added to the list.
There was a problem hiding this comment.
You should not call getWordOfTheDay() in this method, which exists to test addWordOfTheDay(). The latter method adds a WordRecord to testListRecord. You should be calling getWord() and other methods on that WordRecord.
Please let me know if you understand now.
| assertEquals("jingle", wordToday.getWord()); | ||
| assertEquals(DEF_LIST, wordToday.getDefinitions()); | ||
| assertEquals(187, SampleData.getFrequencyByYear(mockWordApi, A_WORD, 2020)); | ||
| assertEquals("jingle", TODAYS_WORD.getWord()); |
There was a problem hiding this comment.
I think you misunderstood my comment. Your code was right before this commit when it called SampleData.getWordOfTheDay(). As it is now written, this does not test getWordOfTheDay() because it does not call it.
ellenspertus
left a comment
There was a problem hiding this comment.
Good job addressing the javadoc issues.
| /** | ||
| * Adds word records to a passed list. | ||
| * | ||
| * @param backingList the list of word records |
There was a problem hiding this comment.
I wouldn't include type information (that the list contains word records) since that is shown automatically in generated javadoc as part of the signature.
No description provided.