public RobotSimulator(Robot robot, TableTop table, IRobotMovingService movingService, IRobotTurningService turningService, IRobotReportingService reportingService)
        {
            if (robot == null)
            {
                throw new ArgumentNullException(nameof(Robot));
            }
            if (table == null)
            {
                throw new ArgumentNullException(nameof(TableTop));
            }
            if (movingService == null)
            {
                throw new ArgumentNullException(nameof(IRobotMovingService));
            }
            if (turningService == null)
            {
                throw new ArgumentNullException(nameof(IRobotTurningService));
            }
            if (reportingService == null)
            {
                throw new ArgumentNullException(nameof(IRobotReportingService));
            }

            _robot            = robot;
            _tableTop         = table;
            _movingService    = movingService;
            _turningService   = turningService;
            _reportingService = reportingService;
        }
示例#2
0
        public void RobotSimulatorTest_ArgumentNullException_4()
        {
            Robot                  robot            = new Robot();
            TableTop               table            = new TableTop(5, 6);
            IRobotMovingService    movingService    = new ToyRobotMovingService();
            IRobotReportingService reportingService = null;
            IRobotTurningService   turningService   = new ToyRobotTurningService();

            RobotSimulator simulator = new RobotSimulator(robot, table, movingService, turningService, reportingService);
        }