private CarMotor m_Car; // the car motor we want to use private void Awake() { m_Rigidbody = GetComponent<Rigidbody>(); m_Car = new CarMotor(); m_Car.SetCarMovementInterface(this); m_Car.InitializeCarMotor(m_CentreOfMassOffset, m_MaximumSteerAngle, m_SteerHelper, m_TractionControl, m_FullTorqueOverAllWheels, m_ReverseTorque, m_Topspeed, m_RevRangeBoundary, m_SlipLimit, m_BrakeTorque); m_Car.SetCarAudioInterface(this); m_Car.InitializeCarAudio(lowPitchMin, lowPitchMax); m_Car.StartSound(); }
private CarMotor m_Car; // the car motor we want to use private void Awake() { m_Rigidbody = GetComponent <Rigidbody>(); m_Car = new CarMotor(); m_Car.SetCarMovementInterface(this); m_Car.InitializeCarMotor(m_CentreOfMassOffset, m_MaximumSteerAngle, m_SteerHelper, m_TractionControl, m_FullTorqueOverAllWheels, m_ReverseTorque, m_Topspeed, m_RevRangeBoundary, m_SlipLimit, m_BrakeTorque); m_Car.SetCarAudioInterface(this); m_Car.InitializeCarAudio(lowPitchMin, lowPitchMax); m_Car.StartSound(); }
public void StartSound() { // Arrange CarMotor car = new CarMotor(); var audio = GetAudioMock(); car.SetCarAudioInterface(audio); //Act car.StartSound(); //Assert audio.Received().StartSound(); }