I know the short answer is Mocks, but any examples would be good. I need to be able to test the following: 1. Connect/disconnect 2. Receive data at set intervals 3. Pause in data transmission, causing my class to attempt reconnect 4. Test that events are firing when expected.
As a start, I was thinking of defining an interface, which would use a stream, which would allow me to simply get my class to connect to any stream, which I could control better than a serial port, and would allow me to do it programmaticly. If anyone has a better idea, I'd greatly appreciate it.