Home > Net >  How to reset the static variables when the unit test? To regenerate the singleton?
How to reset the static variables when the unit test? To regenerate the singleton?

Time:04-13

In unit tests, if the underlying class with static variables, so different methods of unit tests, would interfere with each other by the static variables,
Every time want to know is there any way to run the unit test method, are independent initialize the class?
I baidu again, only to find the Java solution, want to know DotNet similar solution here?

CodePudding user response:

Don't use a static variable
  •  Tags:  
  • C#
  • Related