BenMorris / NetArchTest

A fluent API for .Net that can enforce architectural rules in unit tests.
MIT License
1.39k stars 82 forks source link

Why using mono.cecil #122

Closed meichhorn-conet closed 1 year ago

meichhorn-conet commented 1 year ago

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.

My Question, is mono.cecil the right framework for this? Is maybe Roslyn the better choice? (are any plans to migrate?)

BenMorris commented 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!

NeVeSpl commented 1 year ago

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.