Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6576333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:29:58+00:00 2026-05-25T15:29:58+00:00

Working on a library which communicates with a range of USB devices I want

  • 0

Working on a library which communicates with a range of USB devices I want to develop a suite of API tests to check the integration status of new devices. One of the situations I wish to test is unexpected device removal. Short of creating breakpoints in the test script where the device must be manually unplugged/replugged I would like to be able to simulate this behaviour programattically.

Currently I am simulating this with Devcon but the problem I am facing is that if the API has already connected to the device on an open serial port Devcon cannot close that serial port and so I cannot fully simulate device removal, even though all of the devices manifestations in Device Manager apart from the remaining COM port are removed.

I have been unable to find a solution in my research effort so far, and wondered if anyone had encountered the same problem/knows of a solution.

(Language is c#, .Net2.0)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:29:58+00:00Added an answer on May 25, 2026 at 3:29 pm

    this might be not exactly an answer to your question, but I would do the following:
    Refactor every access to real hardware/devices into interfaces and inject them as dependencies into your code.
    Now you can mock those interfaces and do unit-testing as you like.

    To make integration/real test to the real thing and indeed unplug/plug, etc. the hard way.

    This works fine for me and for many others I think.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an integration test suite(which is a class library) and one of the
I am working with a library which exposes an interface to work with. One
I have a third party library which I finally have working within my MonoTouch
I am working on a library for procedural texture generation ( https://github.com/mikera/clisk ) which
I'm working on a small Fortran library (novel code) which is being called from
I'm working on a library which implements the actor model on top of Grand
I am working on a library which needs to make use of the common
I'm working with the ZeroMQ library which uses void * to represent blocks of
At the moment i working with library which can throw hell alot of different
I am working with a library which returns a "byte string" ( bytes )

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.