Disallow concrete type
Closed this issue · 1 comments
realvizu commented
Use case: For testability purposes accessing System.DateTime directly should be prohibited. All access should be via IEnvironmentInfo interface (eg. IEnvironmentInfo.GetDateTime).
Config should be enhanced to allow defining that a concrete type is accessible from a concrete namespace but inaccessible for all other namespaces.
realvizu commented
Oops, the proposed feature does not fulfill the described use case because it's not the usage of DateTime that should be disallowed but the usage of DateTime.Now, DateTime.UtcNow.
But checking property invocations is clearly outside of the scope of NsDepCop so closing this as won't fix.