Unit Testing with Serial Port
-
Is there a way to override SerialPort.ReadExisting() method? I'm working on the unit testing on the software that involves with Serial Port communication, using "test doubles". Anyone can point me any suggestions? Thanks!
What version of Visual Studio are you using? Ultimate or Premium 2012/2013 can use a Fakes assembly which addresses specifically this with "Shims". Fakes in Visual Studio Testing[^] Or are you using some other kind of testing software (please specify)?
-
What version of Visual Studio are you using? Ultimate or Premium 2012/2013 can use a Fakes assembly which addresses specifically this with "Shims". Fakes in Visual Studio Testing[^] Or are you using some other kind of testing software (please specify)?
-
Is there a way to override SerialPort.ReadExisting() method? I'm working on the unit testing on the software that involves with Serial Port communication, using "test doubles". Anyone can point me any suggestions? Thanks!
-
Is there a way to override SerialPort.ReadExisting() method? I'm working on the unit testing on the software that involves with Serial Port communication, using "test doubles". Anyone can point me any suggestions? Thanks!
An idea would be to write a simulation program which is sending dummy data to a virtual serial port at which your program is listening. You could pair those two virtual ports using com0com.
The busier I am, the more I procrastinate. - Chris "The Mighty" Maunder