internal void RacetrackSettingsSetHandler(RacetrackSettingsSetMessage message)
 {
     m_Bus.PublishAsync(new ColonyRacetrackSettingsSetMessage
                        {
                            TurnRadiusForPort = message.TurnRadiusForPort,
                            TurnRadiusForStarboard = message.TurnRadiusForStarboard,
                            IsPortTurnAllowed = message.IsPortTurnAllowed,
                            IsStarboardTurnAllowed = message.IsStarboardTurnAllowed
                        });
 }
        public void RacetrackSettingsSetHandler_SendsMessage_WhenCalled()
        {
            // Arrange
            var message = new RacetrackSettingsSetMessage
                          {
                              TurnRadiusForPort = 1.0,
                              TurnRadiusForStarboard = 2.0,
                              IsPortTurnAllowed = true,
                              IsStarboardTurnAllowed = true
                          };

            // Act
            m_Model.RacetrackSettingsSetHandler(message);

            // Assert
            m_Bus.Received()
                 .PublishAsync(
                               Arg.Is <ColonyRacetrackSettingsSetMessage>(
                                                                          x =>
                                                                          Math.Abs(x.TurnRadiusForPort - 1.0) <
                                                                          Tolerance &&
                                                                          Math.Abs(x.TurnRadiusForStarboard - 2.0) <
                                                                          Tolerance &&
                                                                          x.IsPortTurnAllowed &&
                                                                          x.IsStarboardTurnAllowed));
        }