data = SubTileDataView.fromSourceAbsolute(tileDatas.get(0), index); } else {
@Test(expected = IllegalArgumentException.class) public void testOutOfBoundsYBin () { SubTileDataView<Integer> underTest = SubTileDataView.fromSourceAbsolute(source16, new TileIndex(1, 1, 1)); underTest.getBin(1,2); }
@Test(expected = IllegalArgumentException.class) public void testOutOfBoundsXBin () { SubTileDataView<Integer> underTest = SubTileDataView.fromSourceAbsolute(source16, new TileIndex(1, 1, 1)); underTest.getBin(2,1); }
@Test(expected = IllegalArgumentException.class) public void testBadRelativeIndex () { TileData<Integer> source = new DenseTileData<>(new TileIndex(1, 0, 0)); SubTileDataView.fromSourceAbsolute(source, new TileIndex(2, 2, 1)); }
@Test(expected = IllegalArgumentException.class) public void testBadRelativeLevel() { TileData<Integer> source = new DenseTileData<>(new TileIndex(3, 0, 0)); SubTileDataView.fromSourceAbsolute(source, new TileIndex(2, 1, 1)); }
@Test public void testSimpleTwoLevels () { SubTileDataView<Integer> underTest = SubTileDataView.fromSourceAbsolute(source16, new TileIndex(2, 1, 1)); Assert.assertEquals(2, underTest.getDefinition().getLevel()); Assert.assertEquals(1, underTest.getDefinition().getX()); Assert.assertEquals(1, underTest.getDefinition().getY()); Assert.assertEquals(1, underTest.getDefinition().getXBins()); Assert.assertEquals(1, underTest.getDefinition().getYBins()); Assert.assertEquals(9, (int)underTest.getBin(0,0)); }
@Test public void testSimple () { SubTileDataView<Integer> underTest = SubTileDataView.fromSourceAbsolute(source16, new TileIndex(1, 1, 1)); Assert.assertEquals(1, underTest.getDefinition().getLevel()); Assert.assertEquals(1, underTest.getDefinition().getX()); Assert.assertEquals(1, underTest.getDefinition().getY()); Assert.assertEquals(2, underTest.getDefinition().getXBins()); Assert.assertEquals(2, underTest.getDefinition().getYBins()); Assert.assertEquals(2, (int)underTest.getBin(0,0)); Assert.assertEquals(7, (int)underTest.getBin(1,1)); }