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); }
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); }
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); }
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); }
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); }