ArchUnitNET
ArchUnitNET copied to clipboard
How to check package references?
Hi I have a question about the package references. I want to check that my project has only two references nuget packages. How can I write a test to garantiere this?
Has someone a code snipped for such a test?
Hi @ChangeTheCode ,
if you refer to the .csproj file when you say "my project" then I would assume that you need a different approach, e.g. parsing the file (it's XML) and assert it's content correspondingly in a unit test. The architecture tests operate on a compiled assembly, not on individual project(s).
So with ArchUnitNET you can test if nuget Types are used in forbidden layer?
As @MSinstein said, actually verifying whether a packaged is referenced in the actual project file is beyond the scope of ArchUnitNET. I'm closing this in favour of #130 which from my understanding covers what you are trying to achieve. Feel free to reopen this issue if you have any other questions.