/*
 * Mutability Detector
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * Further licensing information for this project can be found in 
 * 		license/LICENSE.txt
 */

package org.mutabilitydetector.cli;

import static org.junit.Assert.assertTrue;

import java.io.File;

import org.junit.After;
import org.junit.Test;

public class ClassListReaderFactoryTest {

	private File classListFile;

	@Test
	public void testDefaultReturnedReaderIsPlainTextClassListReader() throws Exception {
		classListFile = new File("somePlainTextFile.txt");
		classListFile.createNewFile();
		ClassListToReportCollector collector = new ClassListReaderFactory(classListFile).createReader();
		
		assertTrue("Should be a plain text reader.", collector instanceof PlainTextClassListToReportReader);
	}
	
	
	@After
	public void tearDown() {
		if (classListFile != null) classListFile.delete();
	}
}

/*
 * Mutability Detector
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * Further licensing information for this project can be found in 
 * 		license/LICENSE.txt
 */

package org.mutabilitydetector.cli;

import static org.junit.Assert.assertTrue;

import java.io.File;

import org.junit.After;
import org.junit.Test;

public class ClassListReaderFactoryTest {

	private File classListFile;

	@Test
	public void testDefaultReturnedReaderIsPlainTextClassListReader() throws Exception {
		classListFile = new File("somePlainTextFile.txt");
		assertTrue(classListFile.createNewFile());
		ClassListToReportCollector collector = new ClassListReaderFactory(classListFile).createReader();
		
		assertTrue("Should be a plain text reader.", collector instanceof PlainTextClassListToReportReader);
	}
	
	
	@After
	public void tearDown() {
		if (classListFile != null) {
			assertTrue(classListFile.delete());
		}
	}
}

Change how the test asserts a file has been deleted.
Change how the test asserts a file has been deleted.

git-svn-id: ed609ce04ec9e3c0bc25e071e87814dd6d976548@63 c7a0535c-eda6-11de-83d8-6d5adf01d787
