public async Task GetBookingByIdAsync_BookingExists_ShouldReturnTheBooking()
        {
            // Arrange
            expectedBooking.Id = bookingId;
            context.Add(expectedBooking);
            context.SaveChanges();

            //Act
            var actualBooking = await repository.GetBookingByIdAsync(bookingId);

            //Assert
            Assert.AreEqual(expectedBooking, actualBooking);
        }
Esempio n. 2
0
        public async Task GetUserAsync_UserExists_ShouldReturnTheUser()
        {
            // Arrange
            login.Email    = expectedUser.Email;
            login.Password = expectedUser.Password;
            context.Add(expectedUser);
            context.SaveChanges();

            //Act
            var actualUser = await repository.GetUserAsync(login);

            //Assert
            Assert.AreEqual(expectedUser, actualUser);
        }
Esempio n. 3
0
        public async Task GetRegionByIdAsync_RegionExists_ShouldReturnTheRegion()
        {
            // Arrange
            expectedRegion.Id = regionId;
            context.Add(expectedRegion);
            context.SaveChanges();

            //Act
            var actualRegion = await repository.GetRegionByIdAsync(regionId);

            //Assert
            Assert.AreEqual(expectedRegion, actualRegion);
        }
        public async Task GetLodgmentByNameAsync_LodgmentExists_ShouldReturnTheLodgment()
        {
            // Arrange
            expectedLodgment.Name      = lodgmentName;
            expectedLodgment.IsActive  = true;
            expectedLodgment.IsDeleted = false;
            context.Add(expectedLodgment);
            context.SaveChanges();

            //Act
            var actualLodgment = await repository.GetLodgmentByNameAsync(lodgmentName);

            //Assert
            Assert.AreEqual(expectedLodgment, actualLodgment);
        }
Esempio n. 5
0
        public async Task DeleteUserByIdAsync_UserExists_ShouldReturnTheUser()
        {
            // Arrange
            context.Add(expectedUser);
            context.SaveChanges();

            // Act
            var actualUser = await repository.DeleteUserByIdAsync(expectedUser.Id);

            // Assert
            Assert.AreEqual(expectedUser, actualUser);
        }
Esempio n. 6
0
        public async Task GetSpotByIdAsync_SpotExists_ShouldReturnTheSpot()
        {
            // Arrange
            expectedSpot.Region = fixture.Create <Region>();
            spotId = expectedSpot.Id;
            context.Add(expectedSpot);
            context.SaveChanges();

            //Act
            var actualSpot = await repository.GetSpotByIdAsync(spotId);

            //Assert
            Assert.AreEqual(expectedSpot, actualSpot);
        }