예제 #1
0
        public async Task VerifyNoDiagnosticAsync(
            string source,
            IEnumerable <string> additionalFiles = null,
            TestOptions options = null,
            CancellationToken cancellationToken = default)
        {
            var state = new DiagnosticTestState(
                Descriptor,
                source,
                spans: null,
                additionalFiles: AdditionalFile.CreateRange(additionalFiles));

            await VerifyNoDiagnosticAsync(
                state,
                options : options,
                cancellationToken);
        }
예제 #2
0
        internal async Task VerifyDiagnosticAsync(
            string source,
            TextSpan span,
            IEnumerable <string> additionalFiles = null,
            TestOptions options = null,
            CancellationToken cancellationToken = default)
        {
            var state = new DiagnosticTestState(
                Descriptor,
                source,
                ImmutableArray.Create(span),
                additionalFiles: AdditionalFile.CreateRange(additionalFiles));

            await VerifyDiagnosticAsync(
                state,
                options : options,
                cancellationToken : cancellationToken);
        }
예제 #3
0
        public async Task VerifyDiagnosticAsync(
            string source,
            IEnumerable <string> additionalFiles = null,
            TestOptions options = null,
            CancellationToken cancellationToken = default)
        {
            var code = TestCode.Parse(source);

            Debug.Assert(code.Spans.Length > 0);

            var state = new DiagnosticTestState(
                Descriptor,
                code.Value,
                code.Spans,
                code.AdditionalSpans,
                additionalFiles: AdditionalFile.CreateRange(additionalFiles));

            await VerifyDiagnosticAsync(
                state,
                options : options,
                cancellationToken : cancellationToken);
        }