}
@Test
public void test2x1() {
Grid grid = new Grid(LayoutTokens.parse("*;*"), LayoutTokens.parse("*"));
Assert.assertEquals(2, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(1, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
+ "┌─┬─┐\n"
+ "│◌│◌│\n"
+ "└─┴─┘\n", grid.gridAsString());
grid.add(new OriginCell(null), 1, 1);
Assert.assertEquals(2, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(1, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
+ "┏━┱─┐\n"
+ "┃█┃◌│\n"
+ "┗━┹─┘\n", grid.gridAsString());
grid.add(new OriginCell(null), 1, 1);
Assert.assertEquals(2, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(1, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
+ "┏━┳━┓\n"
+ "┃█┃█┃\n"
+ "┗━┻━┛\n", grid.gridAsString());
grid.add(new OriginCell(null), 2, 2);
Assert.assertEquals(2, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(3, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
+ "┏━┳━┓\n"
+ "┃█┃█┃\n"
+ "┣━╇━┫\n"
+ "┃█│➞┃\n"
+ "┠─┼─┨\n"
+ "┃⬇│⬇┃\n"
+ "┗━┷━┛\n", grid.gridAsString());
grid.add(new OriginCell(null), 1, 2);
Assert.assertEquals(2, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(5, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
+ "┏━┳━┓\n"
+ "┃█┃█┃\n"
+ "┣━╇━┫\n"
+ "┃█│➞┃\n"
+ "┠─┼─┨\n"
+ "┃⬇│⬇┃\n"
+ "┣━╈━┩\n"
+ "┃█┃◌│\n"
+ "┠─╂─┤\n"
+ "┃⬇┃◌│\n"
+ "┗━┹─┘\n", grid.gridAsString());
grid.add(new OriginCell(null), 1, 1);
Assert.assertEquals(2, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(5, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
+ "┏━┳━┓\n"
+ "┃█┃█┃\n"
+ "┣━╇━┫\n"
+ "┃█│➞┃\n"
+ "┠─┼─┨\n"
+ "┃⬇│⬇┃\n"
+ "┣━╈━┫\n"
+ "┃█┃█┃\n"
+ "┠─╊━┩\n"
+ "┃⬇┃◌│\n"
+ "┗━┹─┘\n", grid.gridAsString());
grid.add(new OriginCell(null), 1, 2);
Assert.assertEquals(2, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(6, grid.getBankHeads(Orientation.VERTICAL).length);
Assert.assertEquals(""
+ "┏━┳━┓\n"
+ "┃█┃█┃\n"
+ "┣━╇━┫\n"
+ "┃█│➞┃\n"
+ "┠─┼─┨\n"
+ "┃⬇│⬇┃\n"
+ "┣━╈━┫\n"
+ "┃█┃█┃\n"
+ "┠─╊━┫\n"
+ "┃⬇┃█┃\n"
+ "┡━╉─┨\n"
+ "│◌┃⬇┃\n"
+ "└─┺━┛\n", grid.gridAsString());
grid.add(new OriginCell(null), 2, 1);
// fehler
Assert.assertEquals(2, grid.getBankHeads(Orientation.HORIZONTAL).length);
Assert.assertEquals(6, grid.getBankHeads(Orientation.VERTICAL).length);
}