public void GivenAParkinglotService_WhenReduceAvailablePlacesParkinglot_ThenThrowExceptionIfGoesNegative()
        {
            //Given
            Parkinglot newParkinglot = new Parkinglot()
            {
                AvailablePlaces = 0
            };
            IParkinglotRepository parkinglotRepository = Substitute.For <IParkinglotRepository>();

            var parkinglotService = new ParkinglotService(parkinglotRepository);
            //When
            Action action = () => parkinglotService.ReduceAvailableParkingSpots(newParkinglot);

            //Then
            Assert.Throws <EntityNotValidException> (action);
        }
        public void GivenAParkinglotService_WhenReduceAvailablePlacesParkinglot_ThenReduceAvailablePlaces()
        {
            //Given
            Parkinglot newParkinglot = new Parkinglot()
            {
                AvailablePlaces = 5
            };
            IParkinglotRepository parkinglotRepository = Substitute.For <IParkinglotRepository>();

            var parkinglotService = new ParkinglotService(parkinglotRepository);

            parkinglotRepository.UpdateParkinglot(newParkinglot).Returns(true);
            //When
            parkinglotService.ReduceAvailableParkingSpots(newParkinglot);

            //Then
            Assert.Equal(4, newParkinglot.AvailablePlaces);
        }