Exemple #1
0
        public async Task GetSpotsAsync_NoRestrictions_ShouldReturnTheRegions()
        {
            // Arrange
            paging       = new PagingModel();
            paging.Order = OrderByIdKey;
            await context.AddRangeAsync(expectedRegions);

            await context.SaveChangesAsync();

            // Act
            var actualPaginatedRegions = await repository.GetSpotsAsync(paging);

            // Assert
            Assert.AreEqual(expectedRegions.Count(), actualPaginatedRegions.Data.Count());
        }
        public async Task GetBookingsAsync_ThereAreUsers_ShouldReturnThePaginatedUsers()
        {
            // Arrange
            paging       = new PagingModel();
            paging.Order = "Id";
            context.Add(expectedBooking);
            await context.SaveChangesAsync();

            //Act
            var actualPaginatedUsers = await repository.GetBookingsAsync(paging);

            //Assert
            Assert.AreEqual(expectedBooking, actualPaginatedUsers.Data.First());
        }
        public async Task GetLodgmentsAsync_ThereAreLodgments_ShouldReturnThePaginatedLodgments()
        {
            // Arrange
            paging       = new PagingModel();
            paging.Order = "Id";
            expectedLodgment.IsActive  = true;
            expectedLodgment.IsDeleted = false;
            context.Add(expectedLodgment);
            await context.SaveChangesAsync();

            //Act
            var actualPaginatedLodgments = await repository.GetLodgmentsAsync(paging);

            //Assert
            Assert.AreEqual(expectedLodgment, actualPaginatedLodgments.Data.First());
        }