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;
        }
Beispiel #2
0
        public void RobotSimulatorTest_ArgumentNullException_3()
        {
            Robot                  robot            = new Robot();
            TableTop               table            = new TableTop(5, 6);
            IRobotMovingService    movingService    = null;
            IRobotReportingService reportingService = new ToyRobotReportingService();
            IRobotTurningService   turningService   = new ToyRobotTurningService();

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