PacketMediator/PacketMediator.Generator/PacketMediator.Generator.Tests/Utils/TestAdditionalFile.cs
2025-01-17 14:29:20 +01:00

20 lines
497 B
C#

using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
namespace PacketMediator.Generator.Tests.Utils;
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; }
}