From 1694b19bf5bf808c621be096da7f568e62fdd4dd Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Wed, 23 Nov 2016 22:00:00 +0100 Subject: [PATCH] Removing duplicated code --- .../org/craftedsw/tripservicekata/trip/TripServiceShould.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/TDD/src/test/java/org/craftedsw/tripservicekata/trip/TripServiceShould.java b/TDD/src/test/java/org/craftedsw/tripservicekata/trip/TripServiceShould.java index b8177d0..3b87700 100644 --- a/TDD/src/test/java/org/craftedsw/tripservicekata/trip/TripServiceShould.java +++ b/TDD/src/test/java/org/craftedsw/tripservicekata/trip/TripServiceShould.java @@ -24,6 +24,7 @@ public class TripServiceShould { @Before public void setUp() { tripService = new TesteableTripService(); + loggedInUser = REGISTERED_USER; } @Test(expected=UserNotLoggedInException.class) public void @@ -34,9 +35,7 @@ public class TripServiceShould { } @Test public void - not_return_any_trips_when_users_are_not_friends() { - loggedInUser = REGISTERED_USER; - + not_return_any_trips_when_users_are_not_friends() { User friend = new User(); friend.addFriend(ANOTHER_USER); friend.addTrip(TO_BRAZIL); @@ -49,9 +48,7 @@ public class TripServiceShould { } @Test public void - return_friend_trips_when_users_are_friends() { - loggedInUser = REGISTERED_USER; - + return_friend_trips_when_users_are_friends() { User friend = new User(); friend.addFriend(loggedInUser); friend.addFriend(ANOTHER_USER); -- 2.1.4