Skip to content

Commit

Permalink
Merge pull request #28 from Hosch250/Issue27
Browse files Browse the repository at this point in the history
This should fix issue #27.
  • Loading branch information
Vannevelj committed May 2, 2016
2 parents 1ae65c4 + d7a3f92 commit 5585c1f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions RoslynTester/RoslynTester/Helpers/DiagnosticVerifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,13 @@ internal static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyze
{
var compilation = project.GetCompilationAsync().Result;

var systemDiags = compilation.GetDiagnostics();
// We're ignoring the diagnostic that tells us we don't have a main method
// We're also ignoring the diagnostics that complain about not being able to find a type or namespace
if (systemDiags.Where(x => x.Id != "CS5001" && x.Id != "BC30420" && x.Id != "CS0246").Any(d => d.Severity == DiagnosticSeverity.Error))
var systemDiags = compilation.GetDiagnostics()
.Where(x => x.Id != "CS5001" && x.Id != "BC30420" && x.Id != "CS0246")
.ToList();

if (systemDiags.Any(d => d.Severity == DiagnosticSeverity.Error))
{
var firstError = systemDiags.First(d => d.Severity == DiagnosticSeverity.Error);
throw new InvalidCodeException(
Expand Down

0 comments on commit 5585c1f

Please sign in to comment.