Exemple #1
0
        private void RunTest(int cellId, List <int> target)
        {
            // compute the result
            var result = WARHexGrid.FindCellNeighborIDs(cellId, nColumns, nRows);

            // make sure we got the right amount
            Assert.AreEqual(target.Count, result.Count);
            target.Sort();
            result.Sort();
            // make sure each element is what we expect
            Assert.AreEqual(target, result);
        }
Exemple #2
0
        public void TopRightCornerEven()
        {
            // compute the result
            var result = WARHexGrid.FindCellNeighborIDs(28, 3, 10);
            var target = new List <int> {
                29, 27, 26
            };

            // make sure we got the right amount
            Assert.AreEqual(target.Count, result.Count);
            target.Sort();
            result.Sort();
            // make sure each element is what we expect
            Assert.AreEqual(target, result);
        }