package org.forkalsrud.album.exif;

import org.forkalsrud.album.exif.OggIdentifier.Codec;
import org.junit.Assert;
import org.junit.Test;

public class OggIdentifierTest {

    @Test
	public void testVideoIdentifier() throws Exception {

		Codec codec = OggIdentifier.getIdentifier(getClass().getResourceAsStream("/videoheader.ogg"));
		Assert.assertNotNull(codec);
		Assert.assertEquals("video/ogg; codecs=theora", codec.getMimeType());
	}


    @Test
	public void testAudioIdentifier() throws Exception {

		Codec codec = OggIdentifier.getIdentifier(getClass().getResourceAsStream("/musicheader.ogg"));
		Assert.assertNotNull(codec);
		Assert.assertEquals("audio/ogg; codecs=vorbis", codec.getMimeType());
	}

    @Test
	public void testInvalidIdentifier() throws Exception {

		Codec codec = OggIdentifier.getIdentifier(getClass().getResourceAsStream("OggIdentifierTest.class"));
		Assert.assertNull(codec);
	}
}
