test(device): fold EndToEndTests into DaqifiDeviceWithTransportTests - #794
Merged
Merged
Conversation
The four facts and private MockMemoryStreamTransport repeat DaqifiDeviceWithTransportTests and DaqifiDeviceWithMessageProducerTests. Command strings stay pinned in ScpiMessageProducerTests. Co-authored-by: Tyler Kron <tylerkron@gmail.com>
2 of 3 tasks
…their twin Two of the four deleted EndToEndTests facts pinned behavior no other test covers: that Disconnect drains several queued commands (in order) rather than dropping the queue, and that two connected devices each write only to their own stream. Move both into DaqifiDeviceWithTransportTests on its existing MockStreamTransport; the order check is new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tylerkron
marked this pull request as ready for review
September 27, 2026 17:12
Contributor
Author
|
/agentic_review |
PR Summary by QodoConsolidate device end-to-end tests with transport tests
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you |
Contributor
Author
|
Qodo-clean, CI green — ready for review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/Daqifi.Core.Tests/Integration/EndToEndTests.cswas a stray one-file folder whose four facts overlapped the device transport tests that live next to the production code. Two facts were pure duplicates. The other two pinned behavior nothing else covers, so they move intoDaqifiDeviceWithTransportTestsinstead of being dropped. The file, its privateMockMemoryStreamTransport(a copy ofMockStreamTransport), and theIntegrationfolder go away. No project, solution, CI or filter plumbing referenced the folder.Deleted (already covered)
EndToEnd_DeviceWithStreamConstructor_ShouldMaintainBackwardCompatibilityis identical toDaqifiDeviceWithMessageProducerTests.DaqifiDevice_SendMessage_WhenConnected_ShouldWriteToStream: stream constructor, connect, sendSYSTem:SYSInfoPB?, disconnect, assert on the stream.EndToEnd_MessageProducerLifecycle_ShouldHandleStartStopCorrectlyconnects, sends, disconnects twice onto the sameMemoryStream.DaqifiDevice_DisconnectThenConnect_SendsToCurrentTransportStreamis stronger. It rotates the transport stream between cycles and requires the post-reconnect send to land on the new one.Connectwrites nothing to the stream itself, so itsNotEmptycheck really is the second send.Kept, moved next to
DaqifiDevice_WithMockTransport_ShouldConnectAndSendMessagesEndToEnd_MockTransport_ShouldDeliverSCPICommands→DaqifiDevice_Disconnect_FlushesEveryQueuedCommandInOrder. The twin sends one command. A single write can already be done beforeDisconnectruns, so it cannot tell aDisconnectthat drains the producer queue (StopSafely) from one that clears it (Stop).MessageProducerTestspin multi-message draining at the producer level, not throughDaqifiDevice.Disconnect. The moved fact queues four commands throughdevice.Sendand then disconnects. It now also asserts they reach the stream in order (it usedContainsbefore). The status-event assertions are dropped because the twin already makes exactly those.EndToEnd_MultipleDevices_ShouldWorkIndependently→DaqifiDevice_TwoDevicesOnSeparateTransports_EachWritesOnlyToItsOwnStream. No other test connects twoDaqifiDeviceinstances at once. If a producer, queue or stream ever got shared between instances, this is the only test that would catch it.Both use the class's existing
MockStreamTransport, which gains aGetWrittenContent()helper.Out of scope
No production changes. No edits to ConnectionGuard, LiveCsv, Firmware or StreamMessageConsumer tests.
🤖 Generated with Claude Code