1 write to Exception
Microsoft.CodeAnalysis (1)
SourceGeneration\RunResults.cs (1)
101
this.
Exception
= exception;
34 references to Exception
Microsoft.CodeAnalysis (1)
SourceGeneration\RunResults.cs (1)
119
/// When generation fails due to an <see cref="
Exception
"/> being thrown, a single diagnostic is added
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (33)
SourceGeneration\GeneratorDriverTests.cs (18)
566
Assert.Null(result.
Exception
);
599
Assert.Null(result.
Exception
);
633
Assert.Null(result1.
Exception
);
639
Assert.Null(result2.
Exception
);
644
Assert.Null(result3.
Exception
);
685
Assert.Null(result1.
Exception
);
691
Assert.Null(result2.
Exception
);
1074
Assert.Null(result.
Exception
);
1107
Assert.Null(result1.
Exception
);
1113
Assert.Null(result2.
Exception
);
1118
Assert.Null(result3.
Exception
);
1457
Assert.Equal(e, runResults.Results[0].
Exception
);
1482
Assert.Equal(e, runResults.Results[0].
Exception
);
1525
Assert.Equal(e, runResults.Results.Single().
Exception
);
1554
Assert.Equal(e, runResults.Results[0].
Exception
);
1587
Assert.Equal(e, runResults.Results[0].
Exception
);
4583
Assert.IsType<ArgumentException>(result.
Exception
);
4636
var exception = Assert.IsType<InvalidOperationException>(result.
Exception
);
SourceGeneration\SyntaxAwareGeneratorTests.cs (15)
390
Assert.NotNull(results.Results[0].
Exception
);
391
Assert.Equal("Test Exception", results.Results[0].
Exception
?.Message);
432
Assert.NotNull(results.Results[0].
Exception
);
433
Assert.Equal("Test Exception", results.Results[0].
Exception
?.Message);
522
Assert.NotNull(results.Results[0].
Exception
);
523
Assert.Equal("Test Exception", results.Results[0].
Exception
?.Message);
1869
Assert.NotNull(results.Results[0].
Exception
);
1870
Assert.Equal("Test Exception", results.Results[0].
Exception
?.Message);
1910
Assert.NotNull(results.Results[0].
Exception
);
1911
Assert.Equal("Test Exception", results.Results[0].
Exception
?.Message);
1956
Assert.NotNull(results.Results[0].
Exception
);
1957
Assert.Equal("Test Exception", results.Results[0].
Exception
?.Message);
1960
Assert.Null(results.Results[1].
Exception
);
2060
Assert.IsType<OperationCanceledException>(results.Results[0].
Exception
);
2061
Assert.Equal("Simulated cancellation from external source", results.Results[0].
Exception
!.Message);