Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't consider type name used as string #147

Open
rbashoka opened this issue Oct 3, 2024 · 2 comments
Open

Don't consider type name used as string #147

rbashoka opened this issue Oct 3, 2024 · 2 comments

Comments

@rbashoka
Copy link

rbashoka commented Oct 3, 2024

Following code is considering the type name used as string also as dependency.

Types.InAssembly(Assembly.LoadFrom(fromAssembly))
.ShouldNot()
.HaveDependencyOnAny(typesInOtherAssemblyAsStrings)
.GetResult();

For example, one of the types in "typesInOtherAssemblyAsStrings" is "a.b.cde". A string constant in "fromAssembly" is:
private const string s_TypeNameAsString = "a.b.cde"

Is there a way to exclude checking for such logical dependencies and check only explicit dependencies?

@NeVeSpl
Copy link
Contributor

NeVeSpl commented Oct 3, 2024

There is no switch, that allows excluding it.

  • HaveDependencyOn
  • HaveDependencyOnAny
  • HaveDependencyOnAll

are checking a constant string field.

but it would be a good idea to make this optional.

@rbashoka
Copy link
Author

rbashoka commented Oct 3, 2024

Thanks for quick response.
Yes, it would be good idea to make this optional. May be we can keep this issue open to track this.

NeVeSpl added a commit to NeVeSpl/NetArchTest.eNhancedEdition that referenced this issue Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants