示例#1
0
        public void GetTripsByUser_WhenNotLoggedIn_ThrowsException()
        {
            MockTripService tripService = new MockTripService();

            _user = null;

            Assert.Throws <UserNotLoggedInException>(() => tripService.GetTripsByUser(null));
        }
示例#2
0
        public void GetTripsByUser_WhenLoggedInAndNotFriends_ReturnsEmptyTripList()
        {
            MockTripService tripService = new MockTripService();

            User.User user = new User.User();

            var result = tripService.GetTripsByUser(user);

            Assert.IsInstanceOf <List <Trip.Trip> >(result);
            Assert.AreEqual(0, result.Count);
        }
示例#3
0
        public void GetTripsByUser_WhenLoggedInAndFriends_ReturnsTrips()
        {
            MockTripService tripService = new MockTripService();

            _user = new User.User();
            User.User usersFriend = new User.User();
            usersFriend.AddFriend(_user);
            usersFriend.AddTrip(new Trip.Trip());

            var result = tripService.GetTripsByUser(usersFriend);

            Assert.IsInstanceOf <List <Trip.Trip> >(result);
            Assert.AreNotEqual(0, result.Count);
        }