Пример #1
0
        /// <summary>
        /// Convienence method used for creating moves with y positions for <see cref="C4TestingBoard"/>
        /// </summary>
        /// <param name="x">The x position of the move</param>
        /// <param name="y">The y position of the move</param>
        /// <returns>A <see cref="C4Move"/> with the x and y positions set to the passed in values</returns>
        private C4Move CreateMove(int x, int y)
        {
            C4Move result = new C4Move(x);

            result.SetY(y);
            return(result);
        }
Пример #2
0
        public void SetInvalidYPositionTest()
        {
            //Attempt to set a y position of 100 to a move, which should not work
            //This should throw an InvalidMoveException
            C4Move move = new C4Move(0);

            Assert.Throws <InvalidMoveException>(() => move.SetY(100));
        }
Пример #3
0
        public void SetValidYPositionTest()
        {
            //Attempt to assign a y position of 5 to a move, which should be valid
            C4Move move = new C4Move(2);

            move.SetY(5);
            Assert.AreEqual(5, move.Y);
        }