Why is it hard to unit test a system that depends on singletons?

前端 未结 7 1841
Happy的楠姐
Happy的楠姐 2020-12-02 23:41

I\'ve read cases for and against using the singleton pattern. One common case against describes the difficulties in unit testing with singletons, but I\'m unclear as to why

相关标签:
7条回答
  • 2020-12-03 00:02

    This Google Techtalk does a pretty good job of describing the problems with singletons and global state when it comes to unit testing.

    0 讨论(0)
提交回复
热议问题