Closed meichhorn-conet closed 1 year ago
If memory serves me correctly, I looked into using Roslyn when I was planning the first version of NetArchTest as this was the most obvious place to start. However, Roslyn didn't expose the detail necessary to get dependency searches working. You need to get to the level of instructions within each type.
That was about five years ago and I don't know if the situation with Roslyn has changed. Even so, I am not sure if I migration would yield much return on the enormous amount of work that would be involved!
Roslyn is more than capable of supporting everything that NetArchTest needs and switching to it would not be that tedious.
The problem is that there is no easy and fast enough way to access Roslyn from unit tests that would work with any test adapter or CLI.
First of all, I like the idea behind the framework. Easy testing of architecture decisions and I like the fluent api.
For an existing project, I have created two nunit test cases.
Controllers_Must_Not_Use_DbContext_And_IRepository
(because of decision for strictly using CQRS)Controllers_Must_Not_Have_Static_Fields
both implemented with an extension method forMeetCustomRule
My Question, is mono.cecil the right framework for this? Is maybe Roslyn the better choice? (are any plans to migrate?)