Exemple #1
0
        public async Task GetSpotsByRegionIdAsync_RegionAndSpotsExist_ShouldReturnThePaginatedSpots()
        {
            // Arrange
            paging       = new PagingModel();
            paging.Order = "Id";
            regionId     = expectedSpot.RegionId;
            context.Add(expectedSpot);
            context.SaveChanges();

            //Act
            var actualPaginatedSpots = await repository.GetSpotsByRegionIdAsync(regionId, paging);

            //Assert
            Assert.IsTrue(actualPaginatedSpots.Data.Count() == 1);
            Assert.IsTrue(actualPaginatedSpots.Counts.Total == 1);
            Assert.AreEqual(expectedSpot, actualPaginatedSpots.Data.First());
        }
Exemple #2
0
        public async Task <PaginatedModel <Spot> > GetSpotsByRegionIdAsync(int regionId, PagingModel pagingModel)
        {
            var paginatedSpots = await repository.GetSpotsByRegionIdAsync(regionId, pagingModel);

            return(paginatedSpots);
        }