StackExchange.Precompilation - How can I unit test precompilation diagnostics?

主宰稳场 提交于 2019-12-05 06:55:21

I figure you want to add you diagnostics before the actual emit / compilation, so the steps would be:

  1. create your CSharpCompilation, make sure it has no diagnostic errors before going further
  2. create an BeforeCompileContext, and populate it with the compilation and an empty List<Diagnostic>
  3. create an instance of your ICompileModule and call ICompileModule.BeforeCompile with the context from step 2
  4. check that it contains the required Diagnostic
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!