Refactor Transformer (add Scriban) (#562)

This commit is contained in:
Stef Heyenrath
2021-01-19 21:11:33 +01:00
committed by GitHub
parent 73e73cebb7
commit c35315e610
43 changed files with 1405 additions and 767 deletions

View File

@@ -0,0 +1,26 @@
using WireMock.Handlers;
using WireMock.Types;
using WireMock.Validation;
namespace WireMock.Transformers.Scriban
{
internal class ScribanContextFactory : ITransformerContextFactory
{
private readonly IFileSystemHandler _fileSystemHandler;
private readonly TransformerType _transformerType;
public ScribanContextFactory(IFileSystemHandler fileSystemHandler, TransformerType transformerType)
{
Check.NotNull(fileSystemHandler, nameof(fileSystemHandler));
Check.Condition(transformerType, t => t == TransformerType.Scriban || t == TransformerType.ScribanDotLiquid, nameof(transformerType));
_fileSystemHandler = fileSystemHandler;
_transformerType = transformerType;
}
public ITransformerContext Create()
{
return new ScribanContext(_fileSystemHandler, _transformerType);
}
}
}