msdn: https://msdn.microsoft.com/en-us/library/hh549175.aspx
Stub: https://msdn.microsoft.com/en-us/library/hh549174.aspx
Adding a Fakes Assembly
-
In Solution Explorer, expand your unit test project’s References.
-
Select the assembly that contains the interface definitions for which you want to create stubs.
-
On the shortcut menu, choose Add Fakes Assembly.
单元测试推荐尽可能使用接口,都从容器里来实例化。