Exemplo n.º 1
0
        public void AnalysisRunContext_WhenSyntaxTreeIsNull_ReturnsNull()
        {
            // Arrange
            var ctx = new AnalysisRunContext(null, null);

            // Act & Assert
            ctx.SyntaxTree.Should().BeNull();
        }
Exemplo n.º 2
0
        public void AnalysisRunContext_WhenSupportedDiagnosticsIsNull_ReturnsEmptyCollection()
        {
            // Arrange
            var ctx = new AnalysisRunContext(null, null);

            // Act & Assert
            ctx.SupportedDiagnostics.Should().NotBeNull();
            ctx.SupportedDiagnostics.Should().BeEmpty();
        }
Exemplo n.º 3
0
        public void AnalysisRunContext_ReturnsSameSyntaxTree()
        {
            // Arrange
            var treeMock = new Mock <SyntaxTree>();
            var ctx      = new AnalysisRunContext(treeMock.Object, null);

            // Act & Assert
            ctx.SyntaxTree.Should().Be(treeMock.Object);
        }
Exemplo n.º 4
0
        public void AnalysisRunContext_ReturnsSameCollectionOfDiagnosticDescriptors()
        {
            // Arrange
            var collection = new List <DiagnosticDescriptor>
            {
                new DiagnosticDescriptor("id", "title", "message", "category", DiagnosticSeverity.Error, false)
            };
            var ctx = new AnalysisRunContext(null, collection);

            // Act & Assert
            ctx.SupportedDiagnostics.Should().Equal(collection);
        }