public async Task GetAllByTripIdAsync_NonExistentTripId_ExceptionThrown()
        {
            // Arrange.
            Seed(TripFlipDbContext, RouteEntitiesToSeed);

            var routeService = new RouteService(TripFlipDbContext, Mapper,
                                                CurrentUserService);

            var    nonExistentTripId = 1;
            var    paginationDto     = GetPaginationDto();
            string searchString      = null;

            // Act + Assert.
            await Assert.ThrowsExceptionAsync <NotFoundException>(async() =>
                                                                  await routeService.GetAllByTripIdAsync(nonExistentTripId,
                                                                                                         searchString, paginationDto));
        }
        public async Task GetAllByTripIdAsync_ExistentTripId_Successful()
        {
            // Arrange.
            var routeEntitiesToSeed = RouteEntitiesToSeed;

            Seed(TripFlipDbContext, TripEntityToSeed);
            Seed(TripFlipDbContext, routeEntitiesToSeed);

            CurrentUserService = CreateCurrentUserService(ValidUser.Id, ValidUser.Email);

            var routeService = new RouteService(TripFlipDbContext, Mapper,
                                                CurrentUserService);

            var    existentTripId = 1;
            var    paginationDto  = GetPaginationDto();
            string searchString   = null;

            var routeDtoComparer = new RouteDtoComparer();

            var expectedRouteDtoList = Mapper.Map <List <RouteDto> >(routeEntitiesToSeed);

            // Act.
            var resultRouteDtoPagedList = await routeService.GetAllByTripIdAsync(existentTripId,
                                                                                 searchString, paginationDto);

            var resultRouteDtoList = resultRouteDtoPagedList.Items.ToList();

            var expectedRouteDtosCount = expectedRouteDtoList.Count;

            // Assert.
            Assert.AreEqual(expectedRouteDtosCount, resultRouteDtoList.Count);

            for (var i = 0; i < expectedRouteDtosCount; i++)
            {
                Assert.AreEqual(0,
                                routeDtoComparer.Compare(resultRouteDtoList[i], expectedRouteDtoList[i]));
            }
        }