How to simulate network failure for test purposes (in C#)?

前端 未结 11 806
被撕碎了的回忆
被撕碎了的回忆 2020-12-29 04:25

I\'m building what could be called the DAL for a new app. Unfortunately, network connectivity to the database is a real problem.

I\'d like to be able to temporarily

11条回答
  •  灰色年华
    2020-12-29 05:30

    Try blocking the connection with a firewall midway through the session maybe?

    I like the wrapper idea as well, but thats kind of abstracting the problem and you prolly might not get exact real world behavior. Also, inserting the wrapper layer and then removing it may be more trouble than its worth.

    Edit: Run a script that turns the Network adapter on/off randomly or at set intervals?

提交回复
热议问题