package org.bench4q.recorder;

import static org.junit.Assert.*;

import org.bench4q.recorder.httpcapture.generator.ContentDecoder;
import org.bench4q.recorder.httpcapture.generator.GzipDecoder;
import org.junit.Test;

public class ContentDecoderTest {

	@Test
	public void testWithNullEncoding() {
		ContentDecoder contentDecoder = ContentDecoder.createDecoder(null);
		assertTrue(contentDecoder instanceof ContentDecoder);
	}

	@Test
	public void testWithLowerCaseEncoding() {
		ContentDecoder contentDecoder = ContentDecoder.createDecoder("gzip");
		assertTrue(contentDecoder instanceof GzipDecoder);
	}

	@Test
	public void testWithUpperCaseEncoding() {
		ContentDecoder contentDecoder = ContentDecoder.createDecoder("GZIP");
		assertTrue(contentDecoder instanceof GzipDecoder);
	}

	@Test
	public void testWithMixCaseEncoding() {
		ContentDecoder contentDecoder = ContentDecoder.createDecoder("Gzip");
		assertTrue(contentDecoder instanceof GzipDecoder);
	}

	@Test
	public void testWithNotSupportedEncoding() {
		ContentDecoder contentDecoder = ContentDecoder.createDecoder("deflate");
		assertTrue(contentDecoder instanceof ContentDecoder);
	}
}
