-
Notifications
You must be signed in to change notification settings - Fork 84
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
NetArchTest ignores a nameof expression #81
Comments
It is happening because |
yes, it's. But it's still incorrect I think, isn't it? So would be nice to fix it |
Let's imagine, that Domain and Infrastructure are separate assemblies. In this case, I deliberately should add a reference to Infrastructure assembly into the Domain assembly to use |
I faced with the strange behavior by NetArchTest when I worked with the
nameof
expression.I have a simple an architecture test which is below:
As you see, I want to avoid dependencies on the Infrastructure in the Domain layer (according to the Onion architecture it's wrong).
Now I'm going to apply this arch. test for my pet project .
To reproduce a strange behavior with
nameof
I deliberately decided to instantiate an object withCustomDbContext
type(Infrastructure) in theCustomType
(Domain). This means that I added a dependency on the Infrastructure layer in the Domain layer.And now is an interesting moment, cuz, when I'm wrapping
CustomDbContext
into thenameof
expr. (is evaluated at compile-time), then my arch test is successfully passing, but in fact, it should not. When I don't usenameof
, the arch. test result is failed, and that is correct.Watch my screencast here to realize an issue.
Also, visit my pet project to reproduce an issue
The text was updated successfully, but these errors were encountered: