What I understand is that you should design your tests to be another client for your code... so if in your production code you have an explicit API to use for your client... you should also use that API for your tests...
In particular look how I used the internal class Game::Board but I don't have a test for that class, because its behavior is already covered in the tests for the game.
This is a small example, but I hope you can find it useful =)
I appreciate the example, but could you just link to the source code instead of posting it? It's about seven pages of scrolling and I'm concerned that it might stifle additional responses.
What I understand is that you should design your tests to be another client for your code... so if in your production code you have an explicit API to use for your client... you should also use that API for your tests...
I prepared an small example with the TicTacToe game. You can find it on gist.github.com/bhserna/882d5101bd......
In particular look how I used the internal class
Game::Board
but I don't have a test for that class, because its behavior is already covered in the tests for the game.This is a small example, but I hope you can find it useful =)
Hi,
I appreciate the example, but could you just link to the source code instead of posting it? It's about seven pages of scrolling and I'm concerned that it might stifle additional responses.
Thanks!
Ready! I just remove the code from the post... It would be nice to see an example from you also =)
Thanks! I don't have one. I'm going to go back and read Robert Martin's post all over again.