Beispiel #1
0
        public void GetCellFromPoint()
        {
            WorldGrid grid = new WorldGrid(10000, 10000, 1000, 1000);

            Assert.Equal(
                new Tuple <int, int>(6, 1),
                grid.GetCellFromPoint(new Point(5200, 120))
                );
            Assert.Equal(
                new Tuple <int, int>(1, 1),
                grid.GetCellFromPoint(new Point(100, 100))
                );
            Assert.Throws <ArgumentOutOfRangeException>(
                () => grid.GetCellFromPoint(new Point(-200, 200))
                );
        }