public async Task Should_CloseParking() { // Arrange var LHandleCloseParking = new CloseParkingCommandHandler(FMockDbContext.Object, FCommands); var LCommand = new CloseParkingCommand { ParkingName = "Parking-786359" }; // Act var LResult = await LHandleCloseParking.Handle(LCommand, CancellationToken.None); // Assert FMockDbContext .Verify(AMockDbContext => AMockDbContext.SaveChangesAsync(CancellationToken.None), Times.Once); LResult.ToString().Should().Be("()"); }
public async Task Should_LeaveParkingPlace(string AParkingName, int APlaceNumber) { // Arrange var LHandleLeaveParkingPlace = new LeaveParkingPlaceCommandHandler(FMockDbContext.Object, FCommands); var LCommand = new LeaveParkingPlaceCommand { ParkingName = AParkingName, PlaceNumber = APlaceNumber }; // Act var LResult = await LHandleLeaveParkingPlace.Handle(LCommand, CancellationToken.None); // Assert FMockDbContext .Verify(AMockDbContext => AMockDbContext.SaveChangesAsync(CancellationToken.None), Times.Once); LResult.ToString().Should().Be("()"); }