Skip to content

Add NUnit test project and abstract BLE layer behind interfaces#1

Merged
MaceWindu merged 1 commit into
masterfrom
add-nunit-tests-and-ble-wrapper
May 11, 2026
Merged

Add NUnit test project and abstract BLE layer behind interfaces#1
MaceWindu merged 1 commit into
masterfrom
add-nunit-tests-and-ble-wrapper

Conversation

@MaceWindu
Copy link
Copy Markdown
Owner

Summary

  • Introduces IBluetoothDevice / IBluetoothHost so ElkBledomScanner and ElkBledomDevice are unit-testable; production callers default to the new InTheHand adapters under src/Claudelk.Core/Bluetooth/InTheHand/.
  • Adds tests/Claudelk.Core.Tests/ (NUnit 4 on Microsoft.Testing.Platform) covering protocol byte builders, UserConfig JSON round-trip, scanner name-prefix matching, and the full byte stream each ElkBledomDevice command emits. 80 tests total.
  • Wires dotnet test into the GitHub Actions build job and switches the test project to MTP (UseMicrosoftTestingPlatformRunner=true, OutputType=Exe).

Test plan

  • dotnet build Claudelk.slnx --configuration Release (clean — strict analyzer settings still pass)
  • dotnet test Claudelk.slnx — 80/80 passing under MTP
  • dotnet publish src/Claudelk.Cli -c Release refreshes the production exe; claudelk --help smoke-tested
  • Smoke-test BLE-touching commands (scan, pair, on, color, blink) against a real ELK-BLEDOM strip — the InTheHand adapters still need hardware verification

🤖 Generated with Claude Code

Introduces IBluetoothDevice / IBluetoothHost so ElkBledomScanner and
ElkBledomDevice can be unit-tested without real hardware. Production
callers default to the new InTheHand adapters under
src/Claudelk.Core/Bluetooth/InTheHand/.

Adds tests/Claudelk.Core.Tests/ (NUnit 4 on Microsoft.Testing.Platform)
covering protocol byte builders, UserConfig JSON round-trip, scanner
name-prefix matching, and the full byte stream each ElkBledomDevice
command emits. 80 tests, dotnet test wired into the CI build job.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MaceWindu MaceWindu merged commit a00680e into master May 11, 2026
1 check passed
@MaceWindu MaceWindu deleted the add-nunit-tests-and-ble-wrapper branch May 11, 2026 01:38
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.

1 participant