Closed realvizu closed 7 years ago
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.
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.