package movierental;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

import static org.junit.jupiter.api.Assertions.*;

class RentalTest {

    @ParameterizedTest
    @CsvSource({
            "2, 0, 2.0", // regular movie, no overtime
            "3, 0, 3.5", // regular movie, with overtime
            "1, 1, 3.0", // new release movie, one day
            "2, 1, 6.0", // new release movie, two days
            "3, 2, 1.5", // children movie, no overtime
            "4, 2, 3.0"  // children movie, with overtime
    })
    void should_return_correct_price_for_movie(int daysRented, int movie_type, double expected) {
        // Given
        Movie movie = new Movie("Mock Movie", movie_type);
        Rental rental = new Rental(movie, daysRented);

        // When
        double price = rental.calculatePrice();

        // Then
        assertEquals(expected, price);
    }
}