package patterns.visitor;

import org.junit.Assert;
import org.junit.Test;

import patterns.visitor.components.Change;
import patterns.visitor.components.Code;
import patterns.visitor.components.Growth;
import patterns.visitor.components.Improvement;
import patterns.visitor.components.Refactoring;
import patterns.visitor.components.Unknown;
import patterns.visitor.components.UnsuportedChangeException;

public class StartTest {

	@Test
	public void testTriggerProcessingChangeOfRefactoring() throws Exception {
		Code code = new Code();
		Change change = new Refactoring();

		String actual = new Start().triggerProcessingChangeOf(code, change);

		Assert.assertEquals(Refactoring.LABEL, actual);
	}

	@Test
	public void testTriggerProcessingChangeOfImprovement() throws Exception {
		Code code = new Code();
		Change change = new Improvement();

		String actual = new Start().triggerProcessingChangeOf(code, change);

		Assert.assertEquals(Improvement.LABEL, actual);
	}

	@Test
	public void testTriggerProcessingChangeOfGrowth() throws Exception {
		Code code = new Code();
		Change change = new Growth();

		String actual = new Start().triggerProcessingChangeOf(code, change);

		Assert.assertEquals(Growth.LABEL, actual);
	}

	@Test(expected = UnsuportedChangeException.class)
	public void testTriggerProcessingChangeOfUnknown() throws Exception {
		Code code = new Code();
		Change change = new Unknown();

		new Start().triggerProcessingChangeOf(code, change);
	}
}

@@ -1222,24 +1222,154 @@
 ctual);%0A%09%7D%0A%0A
+%09// Not really needed anymore since a new type will cause a compilation error if implementation%0A%09// of %22accept%22 method is missing%0A
 %09@Test(expec

Document an arguable test