Beispiel #1
0
        public void Neighbor()
        {
            var ijk  = new CoordIjk();
            var zero = new CoordIjk();
            var i    = new CoordIjk(1, 0, 0);

            ijk = ijk.Neighbor(Direction.CENTER_DIGIT);
            Assert.AreEqual(ijk, zero);

            ijk = ijk.Neighbor(Direction.I_AXES_DIGIT);
            Assert.AreEqual(ijk, i);

            ijk = ijk.Neighbor(Direction.INVALID_DIGIT);
            Assert.AreEqual(ijk, i);
        }
Beispiel #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);
            }
        }