/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Compilers/Test/Core/Mocks/TestAdditionalText.cs
31 строка
1 KB
Jared Parsons
API for getting a deterministic key for a Compilation (#57134)
25 янв 2022, 04:09
Не верифицирован
25 янв 2022, 04:09
df86b32
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Text; using System.Threading; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; namespace Roslyn.Test.Utilities { public sealed class TestAdditionalText : AdditionalText { private readonly SourceText? _text; public TestAdditionalText(string path, SourceText? text) { Path = path; _text = text; } public TestAdditionalText(string text = "", Encoding? encoding = null, string path = "dummy", SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1) : this(path, new StringText(text, encoding, checksumAlgorithm: checksumAlgorithm)) { } public override string Path { get; } public override SourceText? GetText(CancellationToken cancellationToken = default) => _text; } }