//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void scheduleTest() public virtual void scheduleTest() { foreach (int tileSize in TILE_SIZES) { Tile tile0 = new Tile(0, 0, (sbyte)0, tileSize); Job job = new Job(tile0, false); QueueItem <Job> queueItem = new QueueItem <Job>(job); Assert.assertEquals(0, queueItem.Priority, 0); MapPosition mapPosition = new MapPosition(new LatLong(0, 0, true), (sbyte)0); QueueItemScheduler.schedule(createCollection(queueItem), mapPosition, tileSize); Assert.assertEquals(0, queueItem.Priority, 0); mapPosition = new MapPosition(new LatLong(0, 180, true), (sbyte)0); QueueItemScheduler.schedule(createCollection(queueItem), mapPosition, tileSize); int halfTileSize = tileSize / 2; Assert.assertEquals(halfTileSize, queueItem.Priority, 0); mapPosition = new MapPosition(new LatLong(0, -180, true), (sbyte)0); QueueItemScheduler.schedule(createCollection(queueItem), mapPosition, tileSize); Assert.assertEquals(halfTileSize, queueItem.Priority, 0); mapPosition = new MapPosition(new LatLong(0, 0, true), (sbyte)1); QueueItemScheduler.schedule(createCollection(queueItem), mapPosition, tileSize); double expectedPriority = Math.hypot(halfTileSize, halfTileSize) + QueueItemScheduler.PENALTY_PER_ZOOM_LEVEL * tileSize; Assert.assertEquals(expectedPriority, queueItem.Priority, 0); } }
private void Schedule(int tileSize) { QueueItemScheduler.schedule(this.queueItems, this.mapViewPosition.MapPosition, tileSize); // TODO //this.queueItems.Sort(QueueItemComparator.INSTANCE); TrimToSize(); }