예제 #1
0
        public void Rotate_Ok_West()
        {
            var t = new Tur.Turtle(_mindField.Object, CompassDirection.West);

            t.Rotate();
            Assert.AreEqual(t.CurentDirection, CompassDirection.North);
        }
예제 #2
0
        public void Moves_Returns_Response_StillInDanger_For_Cannot_move()
        {
            SetMindField(MoveResult.CannotMove);
            var t = new Tur.Turtle(_mindField.Object, CompassDirection.West);

            t.Move();
            Assert.AreEqual(t.CurentStatus, Tur.TurtleStatus.StillInDanger);
        }
예제 #3
0
        public void Moves_Returns_Response_Success()
        {
            SetMindField(MoveResult.Success);
            var t = new Tur.Turtle(_mindField.Object, CompassDirection.West);

            t.Move();
            Assert.AreEqual(t.CurentStatus, Tur.TurtleStatus.Success);
        }
예제 #4
0
        public void Moves_Calls_The_Service()
        {
            SetMindField(MoveResult.MineHit);
            var t = new Tur.Turtle(_mindField.Object, CompassDirection.West);

            t.Move();
            _mindField.Verify(m => m.Move(It.Is <CompassDirection>(cd => cd == CompassDirection.West)), Times.Once);
        }