Skip to content

test: add unit tests for PassiveBuzzerHelper - #487

Open
sakshar2303 wants to merge 1 commit into
oss-slu:developfrom
sakshar2303:test/passive-buzzer-helper
Open

test: add unit tests for PassiveBuzzerHelper#487
sakshar2303 wants to merge 1 commit into
oss-slu:developfrom
sakshar2303:test/passive-buzzer-helper

Conversation

@sakshar2303

Copy link
Copy Markdown
Contributor

Summary

Closes #358

Tests Added

PassiveBuzzerHelperTest.java in com.opensourcewithslu.outputdevices

  • Defaults — verifies frequency=440 and duty cycle=50 on construction
  • passiveBuzzerOn() — correct PWM args, custom values, min/max boundary
  • passiveBuzzerOff() — single and multiple calls
  • getFrequency() — default and manually updated value
  • passiveBuzzTone() — on before off, uses default freq and DC
  • toneIterator() — all 5 frequencies played in order, on/off per frequency
  • piToneSequence() — correct frequency for each pi digit in order, ends with off()
  • setFrequencies() — valid file, out-of-range skip, file not found
    (no throw), single frequency, exact boundary values (20 Hz and 20000 Hz)

All PWM interactions verified via Mockito mock. All tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write unit tests for PassiveBuzzerHelper

1 participant