mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-23 09:30:59 +01:00
22 lines
756 B
C#
22 lines
756 B
C#
using WireMock.Handlers;
|
|
using WireMock.Types;
|
|
using Stef.Validation;
|
|
|
|
namespace WireMock.Transformers.Scriban;
|
|
|
|
internal class ScribanContextFactory : ITransformerContextFactory
|
|
{
|
|
private readonly IFileSystemHandler _fileSystemHandler;
|
|
private readonly TransformerType _transformerType;
|
|
|
|
public ScribanContextFactory(IFileSystemHandler fileSystemHandler, TransformerType transformerType)
|
|
{
|
|
_fileSystemHandler = Guard.NotNull(fileSystemHandler);
|
|
_transformerType = Guard.Condition(transformerType, t => t is TransformerType.Scriban or TransformerType.ScribanDotLiquid);
|
|
}
|
|
|
|
public ITransformerContext Create()
|
|
{
|
|
return new ScribanContext(_fileSystemHandler, _transformerType);
|
|
}
|
|
} |