Timeline for Using methods that are not under test within a unit test for a different method?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 5, 2018 at 1:16 | vote | accept | Shaun Hamman | ||
| Feb 4, 2018 at 13:48 | answer | added | VoiceOfUnreason | timeline score: 0 | |
| Feb 3, 2018 at 11:10 | history | tweeted | twitter.com/StackSoftEng/status/959745963882680320 | ||
| Feb 3, 2018 at 10:20 | comment | added | Doc Brown | @ShaunHamman: if you write a test for ValidateBoard using Board.GenerateFilled() in the shown way, this will be just one sample data case as well. | |
| Feb 2, 2018 at 22:55 | answer | added | David Arno | timeline score: 1 | |
| Feb 2, 2018 at 22:39 | answer | added | Doc Brown | timeline score: 4 | |
| Feb 2, 2018 at 22:09 | comment | added | Shaun Hamman | @kadiii I actually have 4 or 5 tests covering a variety of error cases for ValidateBoard. I had intended to call GenerateFilled then modify the result in ways to match the particular error case I'm testing for. I was hoping to not have to hardcode boards for each case, but I suppose in thinking about it that's more a code management issue than a test logic issue, since calling GenerateFilled is effectively creating sample data anyway. I'm going to leave the question open for a few days, but if you repost your comment as an answer I'll consider it as the solution if no superior answers come in. | |
| Feb 2, 2018 at 20:30 | comment | added | Tomasz Maciejewski | Option 2 is correct. You first test GenerateFilled using ValidateBoard which is absolutely fine. When it comes to testing validateBoard method you need to create many scenarios, both for valid and invalid boards. You can try to identify all cases or at least try to group them to test significantly different scenarios, edge cases, etc. | |
| Feb 2, 2018 at 20:03 | review | First posts | |||
| Feb 3, 2018 at 10:01 | |||||
| Feb 2, 2018 at 20:03 | history | asked | Shaun Hamman | CC BY-SA 3.0 |