Writing unit tests for C# parsing, binding, and codegen phases

This section will enable you to add unit tests for a new C# language feature: Switch operator (?::). For details on the intended functionality of this operator, read the section, New language feature: Switch Operator (?::), at the start of this chapter.

C# compiler has the following set of unit test projects in Roslyn.sln:

  • CSharpCompilerSyntaxTest: This unit tests for parsing and syntax errors.
  • CSharpCompilerSemanticTest: This unit tests for semantic errors and semantic model APIs.
  • CSharpCompilerSymbolTest: This unit tests for symbols defined in the compiler layer.
  • CSharpCommandLineTest: This unit tests for the compiler's command line options.
  • CSharpCompilerEmitTest: This unit ...

Get Roslyn Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.