package projetMusee.backend;

import static org.junit.Assert.*;
import org.junit.*;

import java.util.Arrays;
import java.util.List;

public class MuseumTest {
    private Museum museum;
    private List<String> thematicDomains;
    private Coordinates coordinates;

    @Before
    public void setUp() {
        thematicDomains = Arrays.asList("Art", "Histoire");
        coordinates = new Coordinates(48.8566, 2.3522);
        
        museum = new Museum("1", "Louvre", "Rue de Rivoli", "1er arrondissement", "75001", "Paris",
                "Île-de-France", "75", "https://www.louvre.fr", "01 40 20 50 50", "National",
                thematicDomains, "Fondé en 1793", "Œuvres exceptionnelles", "Peinture, Sculpture",
                "Leonard de Vinci", "Napoléon Bonaparte", "Patrimoine mondial",
                "Monument classé", "Site historique", "123456",
                1793, "2024-03-20", coordinates);
    }

    @Test
   public void testGetAddress() { 
        assertEquals("Rue de Rivoli", museum.getAddress()); }
    
    @Test
   public  void testGetArtist() { 
        assertEquals("Leonard de Vinci", museum.getArtist()); }
    
    @Test
   public void testGetAsset() { 
        assertEquals("Œuvres exceptionnelles", museum.getAsset()); }
    
    @Test
    public void testGetBuildingProtection() { 
        assertEquals("Monument classé", museum.getBuildingProtection()); }
    
    @Test
    public void testGetCategory() { 
        assertEquals("National", museum.getCategory()); }
    
    @Test
    public void testGetCity() { 
        assertEquals("Paris", museum.getCity()); }
    
    @Test
    public void testGetCoordinates() { 
        assertEquals(coordinates, museum.getCoordinates()); }
    
    @Test
    public void testGetCreationYear() { 
        assertEquals(1793, museum.getCreationYear()); }
    
    @Test
    public void testGetDepartment() { 
        assertEquals("75", museum.getDepartment()); }
    
    @Test
    public void testGetHistory() { 
        assertEquals("Fondé en 1793", museum.getHistory()); }
    
    @Test
    public void testGetId() { 
        assertEquals("1", museum.getId()); }
    
    @Test
    public  void testGetInterest() { 
        assertEquals("Patrimoine mondial", museum.getInterest()); }
    
    @Test
    public void testGetKeyFigure() { 
        assertEquals("Napoléon Bonaparte", museum.getKeyFigure()); }
    
    @Test
    public void testGetLastUpdatedDate() { 
        assertEquals("2024-03-20", museum.getLastUpdatedDate()); }
    
    @Test
    public void testGetOfficialName() { 
        assertEquals("Louvre", museum.getOfficialName()); }
    
    @Test
    public  void testGetPhone() { 
        assertEquals("01 40 20 50 50", museum.getPhone()); }
    
    @Test
    public void testGetPlace() { 
        assertEquals("1er arrondissement", museum.getPlace()); }
    
    @Test
    public void testGetPostalCode() { 
        assertEquals("75001", museum.getPostalCode()); }
    
    @Test
    public void testGetRefmer() { 
        assertEquals("123456", museum.getRefmer()); }
    
    @Test
    public void testGetRegion() { 
        assertEquals("Île-de-France", museum.getRegion()); }
    
    @Test
    public void testGetSpaceProtection() { 
        assertEquals("Site historique", museum.getSpaceProtection()); }
    
    @Test
    public void testGetThematicDomain() { 
        assertEquals(thematicDomains, museum.getThematicDomain()); }
    
    @Test
    public void testGetThemes() { 
        assertEquals("Peinture, Sculpture", museum.getThemes()); }
    
    @Test
    public void testGetUrl() { 
        assertEquals("https://www.louvre.fr", museum.getUrl()); }
    
    @Test
    public void testSetAddress() { museum.setAddress("New Address"); 
    assertEquals("New Address", museum.getAddress()); }
    
    @Test
    public void testSetArtist() { museum.setArtist("New Artist"); 
    assertEquals("New Artist", museum.getArtist()); }
    
    @Test
    public  void testSetAsset() { museum.setAsset("New Asset"); 
    assertEquals("New Asset", museum.getAsset()); }
    
    @Test
    public void testSetBuildingProtection() { museum.setBuildingProtection("New Protection"); 
    assertEquals("New Protection", museum.getBuildingProtection()); }
    
    @Test
    public void testSetCategory() { museum.setCategory("Regional"); 
    assertEquals("Regional", museum.getCategory()); }
    
    @Test
    public void testSetCity() { museum.setCity("Lyon"); 
    assertEquals("Lyon", museum.getCity()); }
    
    @Test
    public void testSetCoordinates() { Coordinates newCoords = new Coordinates(45.75, 4.85); museum.setCoordinates(newCoords); 
        assertEquals(newCoords, museum.getCoordinates()); }
    
    @Test
    public  void testSetCreationYear() { museum.setCreationYear(2000); 
        assertEquals(2000, museum.getCreationYear()); }
    
    @Test
    public void testSetDepartment() { museum.setDepartment("69"); 
    assertEquals("69", museum.getDepartment()); }
    
    @Test
    public  void testSetHistory() { museum.setHistory("New History"); 
    assertEquals("New History", museum.getHistory()); }
    
    @Test
    public void testSetId() { museum.setId("2"); 
    assertEquals("2", museum.getId()); }
    
    @Test
    public void testSetInterest() { museum.setInterest("New Interest"); 
    assertEquals("New Interest", museum.getInterest()); }
    
    @Test
    public void testSetKeyFigure() { museum.setKeyFigure("New Figure"); 
    assertEquals("New Figure", museum.getKeyFigure()); }
    
    @Test
    public void testToString() { 
        assertTrue(museum.toString().contains("Louvre")); }
}
