2024-08-07 17:06:55 +00:00
|
|
|
using System.Threading;
|
|
|
|
using Microsoft.CodeAnalysis;
|
|
|
|
using Microsoft.CodeAnalysis.Text;
|
|
|
|
|
2025-01-17 08:53:44 +00:00
|
|
|
namespace PacketMediator.Generator.Tests.Utils;
|
2024-08-07 17:06:55 +00:00
|
|
|
|
|
|
|
public class TestAdditionalFile : AdditionalText
|
|
|
|
{
|
|
|
|
private readonly SourceText _text;
|
|
|
|
|
|
|
|
public TestAdditionalFile(string path, string text)
|
|
|
|
{
|
|
|
|
Path = path;
|
|
|
|
_text = SourceText.From(text);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override SourceText GetText(CancellationToken cancellationToken = new()) => _text;
|
|
|
|
|
|
|
|
public override string Path { get; }
|
|
|
|
}
|