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

前端 未结 11 729
被撕碎了的回忆
被撕碎了的回忆 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:14

    Write a wrapper to the network class connectivity class you're using (e.g. WebClient) with an on-off switch :)

    Either that, or block your application in the firewall.

提交回复
热议问题