package de.thpeetz.kontor.media.data;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import de.thpeetz.kontor.media.repository.MediaFileRepository;

import java.util.List;

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

@SpringBootTest
public class MediaFileTest {

    @Autowired
    private MediaFileRepository mediaFileRepository;

    @Test
    void checkInitialDataLoad() {
        List<MediaFile> mediaFileList = mediaFileRepository.findAll();
        assertTrue(mediaFileList.isEmpty());
    }

    @Test
    void checkDefaultValues() {
        MediaFile mediaFile = new MediaFile();
        assertNull(mediaFile.getUrl());
        assertNull(mediaFile.getTitle());
        assertNull(mediaFile.getFileName());
        assertNull(mediaFile.getPath());
        assertNull(mediaFile.getCloudLink());
        assertNull(mediaFile.getCreatedDate());
        assertNull(mediaFile.getLastModifiedDate());
        assertNull(mediaFile.getId());
        assertFalse(mediaFile.isReview());
        assertFalse(mediaFile.isShouldDownload());
    }
}
