3 ms·
I'm not as familar with Java, but in C# you can use "shims" to accomplish this same result, without DI. http://www.peterprovost.org/blog/2012/04/25/visual-stud
by tarr11 14y ago
I'm not as familar with Java, but in C# you can use "shims" to accomplish this same result, without DI.
http://www.peterprovost.org/blog/2012/04/25/visual-studio-11-fakes-part-2/ http://www.peterprovost.org/blog/2012/04/25/visual-studio-11...
http://msdn.microsoft.com/en-us/library/hh549176.aspx http://msdn.microsoft.com/en-us/library/hh549176.aspx
- nahname 14y agoThe View Model has a dependency on a repository that is injected in via constructor injection. I don't think you understand what DI means.
- tarr11 14y agoShims do not require DI, ViewModels, or Repositories. The second link from MSDN explains this in more detail. The first one just uses those things in their test examples, but they are not required to use shims. Here's an example: // Make DateTime.Now always return midnight Jan 1, 2012 ShimDateTime.NowGet = () => new DateTime(2012, 1, 1);