Пример #1
0
        public void IjkToIj()
        {
            var ijk = new CoordIjk();
            var ij  = ijk.ToIj();

            Assert.AreEqual(0, ij.I);
            Assert.AreEqual(0, ij.J);

            ijk = ij.ToIjk();
            Assert.AreEqual(0, ijk.I);
            Assert.AreEqual(0, ijk.J);
            Assert.AreEqual(0, ijk.K);
        }
Пример #2
0
        public void IjkToIjRoundtrip()
        {
            for (Direction dir = Direction.CENTER_DIGIT; dir < Direction.NUM_DIGITS; dir++)
            {
                var ijk = new CoordIjk();
                ijk = ijk.Neighbor(dir);

                var ij = ijk.ToIj();

                var recovered = ij.ToIjk();

                Assert.AreEqual(ijk, recovered);
            }
        }