Skip to content

Write Unit Tests for ActiveBuzzerHelper #345

Description

@RalphTan37

Description:
Write unit tests for the ActiveBuzzHelper class to ensure the proper functionality of all its methods, including turning the buzzer on and off, executing a beep sequence, playing intermittent tones, and generating Morse code patterns.

Tasks:

  1. Test Buzzer Methods
    Write tests to verify that activeBuzzerOn() correctly sets the duty cycle and frequency, updates actBuzzCheck flag, and logs correct messages
    Write tests for activeBuzzerOff() to confirm that the buzzer turns off and the state flag is updated

  2. Test Beep Method
    Write a test for the beep() method to simulate the 2-second beep sequence
    so the buzzer state transitions are correct

  3. Test Intermittent Tone Method
    Write tests for intermittentTone() to validate that the buzzer toggles on and off for the correct durations

  4. Test Morse Code Tone Method
    Write a test for morseCodeTone() to ensure that the sequence for “pi” in Morse code is executed as intended

Acceptance Criteria:

  • Unit tests correctly covers all methods
  • All tests pass with mock PWM components
  • Messages logged are validated for correct execution

Metadata

Metadata

Assignees

Labels

good-first-issueGood for newcomershacktoberfestOpen for Hacktoberfest contributions. Please follow contribution guidelines and submit meaningful PRunit-testTo ensure individual components or functions work as intended.

Type

Projects

Status
🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions