Open mwasson74 opened 1 year ago
Try using this https://github.com/GuOrg/Gu.Roslyn.Asserts#settings
Maybe something like:
Settings.Default = Settings.Default.WithMetadataReferences(
Asserts.MetadataReferences.Transitive(typeof(Path.To.InjectAttribute)));
It adds default metadata references for all tests. You can also pass metadata references per assert but it tends to produce noisy tests
I am new to testing Roslyn things. I have the following test:
And get the following result:
How do I properly handle usings and other packages that I may need? The
[Inject]
attribute is from the AspNetCore.Components library which I have referenced in my test .csproj but there must be more to it.Any guidance is greatly appreciated.
Thanks,
Matt