Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Unit Testing with Serial Port

Unit Testing with Serial Port

Scheduled Pinned Locked Moved C#
testingbeta-testingquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Blubbo
    wrote on last edited by
    #1

    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!

    R B M 3 Replies Last reply
    0
    • B Blubbo

      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!

      R Offline
      R Offline
      Ron Beyer
      wrote on last edited by
      #2

      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)?

      B 1 Reply Last reply
      0
      • R Ron Beyer

        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)?

        B Offline
        B Offline
        Blubbo
        wrote on last edited by
        #3

        I am using Visual Studio premium 2010

        1 Reply Last reply
        0
        • B Blubbo

          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!

          B Offline
          B Offline
          Blubbo
          wrote on last edited by
          #4

          ... Or the other way to perform "stimulated" serial port communication?

          1 Reply Last reply
          0
          • B Blubbo

            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!

            M Offline
            M Offline
            Marco Bertschi
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups