public async Task Should_Not_Delete_ParkingLot_By_Name_Given_Name_Not_Existed() { //given var parkingLot = GenerateParkingLotDtoInstance(); var dbContext = GetContext(); var parkingLotService = new ParkingLotService(dbContext); await parkingLotService.AddParkingLotAsync(parkingLot); //when await parkingLotService.DeleteParkingLotByIdAsync("notexisted"); //then Assert.Equal(1, dbContext.ParkingLots.Count()); }
public async Task Should_Delete_ParkingLot_By_Id_Successfully() { //given var parkingLot = GenerateParkingLotDtoInstance(); var dbContext = GetContext(); var parkingLotService = new ParkingLotService(dbContext); var name = await parkingLotService.AddParkingLotAsync(parkingLot); //when await parkingLotService.DeleteParkingLotByIdAsync(name); //then Assert.Equal(0, dbContext.ParkingLots.Count()); }