Пример #1
0
        public void SendCommand_WrongCommand_ExceptionThrown(char command)
        {
            IRover          mockedRover = Substitute.For <IRover>();
            IRoverCommander commander   = new RoverCommander(mockedRover);

            Assert.Throws <ArgumentException>(() => commander.SendCommand(command));
        }
Пример #2
0
        public void SendCommand_M_Move()
        {
            IRover          mockedRover = Substitute.For <IRover>();
            IRoverCommander commander   = new RoverCommander(mockedRover);

            commander.SendCommand('M');

            mockedRover.Received(1).Move();
        }
Пример #3
0
        public void SendCommand_R_RotateRoverCW()
        {
            IRover          mockedRover = Substitute.For <IRover>();
            IRoverCommander commander   = new RoverCommander(mockedRover);

            commander.SendCommand('R');

            mockedRover.Received(1).RotateCW();
        }