C
C#3w ago
KamiSzu

Need help with Rolsyn analyzer with referencing assembly in tests.

Hi. I've started to playing arround with analyzers and I faced big obstacle in tests when referencing attribute which lies in analyzer project. repo https://github.com/MalwareX95/SampleAnalizer; Here I'm tring to just make this work so that namespace could be found, but no luck. I'd would be very glad if someone could take a look at this.

var code =
"""
using SampleAnalizer;
""";

var test = new CSharpAnalyzerTest<StaticFieldAnalizer, DefaultVerifier>
{
TestCode = code,
ReferenceAssemblies = ReferenceAssemblies.Net.Net80.WithAssemblies([typeof(StaticField).Assembly.FullName!, typeof(StaticField).Assembly.Location])
};

await test.RunAsync();

var code =
"""
using SampleAnalizer;
""";

var test = new CSharpAnalyzerTest<StaticFieldAnalizer, DefaultVerifier>
{
TestCode = code,
ReferenceAssemblies = ReferenceAssemblies.Net.Net80.WithAssemblies([typeof(StaticField).Assembly.FullName!, typeof(StaticField).Assembly.Location])
};

await test.RunAsync();
GitHub
GitHub - MalwareX95/SampleAnalizer
Contribute to MalwareX95/SampleAnalizer development by creating an account on GitHub.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?