mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-24 01:08:28 +02:00
Refactor Transformer (add Scriban) (#562)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user