Beispiel #1
0
        public void ImmutableGame_Shift_CreateNewImmutableGameCorrectly()
        {
            FifteenImmutable.ImmutableGame game = new FifteenImmutable.ImmutableGame(1, 2, 3, 0);
            game = game.Shift(2);
            FifteenImmutable.Location resultCoordinatesOfZero = game.GetLocation(0);
            int shiftedTile = game[1, 1];

            Assert.AreEqual(2, shiftedTile);
            Assert.AreEqual(0, resultCoordinatesOfZero.X);
            Assert.AreEqual(1, resultCoordinatesOfZero.Y);
        }
Beispiel #2
0
        public void ImmutableGame_Should_BeImmutable()
        {
            FifteenImmutable.ImmutableGame game = new FifteenImmutable.ImmutableGame(1, 2, 3, 0);
            game.Shift(2);
            FifteenImmutable.Location resultCoordinatesOfZero = game.GetLocation(0);
            int shiftedTile = game[0, 1];

            Assert.AreEqual(2, shiftedTile);
            Assert.AreEqual(1, resultCoordinatesOfZero.X);
            Assert.AreEqual(1, resultCoordinatesOfZero.Y);
        }