package com.concurrentperformance.ringingmaster.engine.notation.impl;

import static org.junit.Assert.assertArrayEquals;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import com.concurrentperformance.ringingmaster.engine.notation.impl.NotationSplitter;

@RunWith(Parameterized.class)
public class NotationSplitterTest {

	private NotationSplitter fixture = new NotationSplitter();

	private final String notation;
	private final String[] expectedSplits;
	
	public NotationSplitterTest(String notation, String... expectedSplits) {
		super();
		this.notation = notation;
		this.expectedSplits = expectedSplits;
		
	}

	@Parameters
	public static Collection<Object[]> testValues() {
		return Arrays.asList(new Object[][] { 
			{ "X", new String[]{"X"} }, 
			{ "x", new String[]{"x"} }, 
			{ "x.X", new String[]{"x", "X"} }, 
			{ ".x", new String[]{"x"} }, 
			{ ".x.", new String[]{"x"} }, 
			{ "ET", new String[]{"ET"} }, 
			{ ".Et", new String[]{"Et"} }, 
			{ ".Et.", new String[]{"Et"} }, 
			{ "x.X.12", new String[]{"x", "X", "12"} }, 
			{ "xX12", new String[]{"x", "X", "12"} }, 
			{ "12.34.56.78.90.et.ET", new String[]{"12","34","56","78","90","et","ET"} }, 
			{ "12X34X56X78X90XetXET", new String[]{"12","X","34","X","56","X","78","X","90","X","et","X","ET"} }, 
			{ "x12zxl1l2", new String[]{"x","12","x","1","2"} }, 
			});
	}

	@Test
	public void split() {
		List<String> split = fixture.split(notation);
		String[] actualSplits = new String[split.size()];
		split.toArray(actualSplits);
		assertArrayEquals(expectedSplits, actualSplits);
	}
}
@@ -68,137 +68,8 @@
 l;%0A%0A
-import static org.junit.Assert.assertArrayEquals;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0A
 impo
@@ -223,85 +223,127 @@
 ort 
-com.concurrentperformance.ringingmaster.engine.notation.impl.NotationSplitter
+java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0Aimport static org.junit.Assert.assertArrayEquals
 ;%0A%0A@
@@ -834,25 +834,24 @@
 ng%5B%5D%7B%22X%22%7D %7D,
- 
 %0A%09%09%09%7B %22x%22, n
@@ -865,25 +865,24 @@
 ng%5B%5D%7B%22x%22%7D %7D,
- 
 %0A%09%09%09%7B %22x.X%22,
@@ -903,25 +903,24 @@
 %22x%22, %22X%22%7D %7D,
- 
 %0A%09%09%09%7B %22.x%22, 
@@ -935,25 +935,24 @@
 ng%5B%5D%7B%22x%22%7D %7D,
- 
 %0A%09%09%09%7B %22.x.%22,
@@ -968,25 +968,24 @@
 ng%5B%5D%7B%22x%22%7D %7D,
- 
 %0A%09%09%09%7B %22ET%22, 
@@ -1001,25 +1001,24 @@
 g%5B%5D%7B%22ET%22%7D %7D,
- 
 %0A%09%09%09%7B %22.Et%22,
@@ -1035,25 +1035,24 @@
 g%5B%5D%7B%22Et%22%7D %7D,
- 
 %0A%09%09%09%7B %22.Et.%22
@@ -1070,25 +1070,24 @@
 g%5B%5D%7B%22Et%22%7D %7D,
- 
 %0A%09%09%09%7B %22x.X.1
@@ -1117,25 +1117,24 @@
 X%22, %2212%22%7D %7D,
- 
 %0A%09%09%09%7B %22xX12%22
@@ -1162,25 +1162,24 @@
 X%22, %2212%22%7D %7D,
- 
 %0A%09%09%09%7B %2212.34
@@ -1243,25 +1243,24 @@
 et%22,%22ET%22%7D %7D,
- 
 %0A%09%09%09%7B %2212X34
@@ -1348,25 +1348,24 @@
 %22X%22,%22ET%22%7D %7D,
- 
 %0A%09%09%09%7B %22x12zx
@@ -1368,11 +1368,11 @@
 12zx
-l1l
+z1z
 2%22, 
@@ -1408,17 +1408,16 @@
 ,%222%22%7D %7D,
- 
 %0A%09%09%09%7D);%0A

Fix up tests for all bells upto 30