We will now turn our attention to testing the Track class. We will focus specifically on the different states a Track class can have: STOPPED, PLAYING, and RECORDING. For each of these states, we want to make sure that adding SoundEvents works only if we are in the proper state (RECORDING).
To do so, we could write the following test functions:
- testAddSoundEvent(): This function puts Track in the STOPPED state, calls track.addSoundEvent(0), and checks track.soundEvents().size == 0
- testAddSoundEvent(): This function puts Track in the PLAYING state, calls track.addSoundEvent(0), and checks track.soundEvents().size == 0
- testAddSoundEvent(): This function puts Track in the RECORDING state, calls track.addSoundEvent(0) ...