public void DetectInvalidInputs(params string[] inputs)
        {
            var service = new PacSimInputControlService(mockMovementService.Object);

            foreach (var input in inputs)
            {
                Assert.Throws <ArgumentException>(() => service.ParseCommand(input));
            }

            mockMovementService.VerifyNoOtherCalls();
        }
        public void VerifyReportCalledOnInput()
        {
            var service = new PacSimInputControlService(mockMovementService.Object);

            //execute valid report command
            var command = service.ParseCommand("REPORT");

            Assert.NotNull(command);

            command.Invoke();

            //verify report was called in movement service
            mockMovementService.Verify(s => s.Report());

            //verify nothing else was called
            mockMovementService.VerifyNoOtherCalls();
        }
        public void VerifyPlaceCalledOnInput()
        {
            var service = new PacSimInputControlService(mockMovementService.Object);

            //execute valid place command
            var command = service.ParseCommand("PLACE 0,0,NORTH");

            Assert.NotNull(command);

            command.Invoke();

            //verify place was called in movement service
            mockMovementService.Verify(s => s.Place(0, 0, Models.PacDirection.NORTH));

            //verify nothing else was called
            mockMovementService.VerifyNoOtherCalls();
        }
        public string ExecuteAllInputsOnRealFiveByFiveGridService(params string[] inputs)
        {
            var service = new PacSimInputControlService(new PacSimGridMovementService(5, 5));

            string finalResult = null;

            foreach (var input in inputs)
            {
                try
                {
                    finalResult = service.ParseCommand(input)?.Invoke();
                }
                catch (Exception) { }//ignore invalid inputs
            }

            return(finalResult);
        }