In our soulution we have "decoupled" the Revit Api and our addin.
So what we do is that we have created a layer on top of Revit, which we call "Model". (and one API)
The Model layer has no refrence to RevitAPI, just the API refrence then the API holds the Revit refrence.
This layer basicly creates an copy of the Revit element or method.
Implementing this as an class based on an interface, makes me able to mock the api
behavior when unit testing.
This means that when creating addin tools, we use our "MElement" class, instead of Element..
When calling an "MElement" we route the traffic down to the Element throug the implementation of this API func.
When testing, we asume api to give "correct" results.. and then we can Mock the results wich we
excpect from the api, and test our logics.
This means that we have no 3000++ unit tests running when building i azure devops.
This is a bit of work to get going on, but do give som good decoupling from Revit when developing..