Creating test for refactoring legacy code.
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 20 Nov 2016 22:21:45 +0000 (23:21 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 20 Nov 2016 22:21:45 +0000 (23:21 +0100)
commit2c64bf98bd0b112e95abbd9be41e001ae9220154
treebd410fa3188e76934c44958ff537bd2b8af195e9
parentaa655fdb54443b843262fa34e1c7133bca24c7e2
Creating test for refactoring legacy code.

1. We may not change production code if not covered by tests.
2. Start testing the legacy code following the shortest branch.
3. We should not invoke more classes than the one being under test.
4. We try to create a fluent interface. If we are testing user is not logged in, our test must
set the value making the not logged in user (we will call it GUEST)
5. Making clear that the input parameter in getTripsByUser is useless for the Unit Test throw_an_exception_when_user_is_not_logged_in
TDD/src/main/java/org/craftedsw/tripservicekata/trip/TripService.java
TDD/src/test/java/org/craftedsw/tripservicekata/trip/TripServiceShould.java [new file with mode: 0644]
TDD/src/test/java/org/craftedsw/tripservicekata/trip/TripServiceTest.java [deleted file]