mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 02:08:29 +02:00
Update Transformer functionality to return value instead of string (#858)
This commit is contained in:
@@ -2,22 +2,21 @@ using WireMock.Handlers;
|
||||
using WireMock.Types;
|
||||
using Stef.Validation;
|
||||
|
||||
namespace WireMock.Transformers.Scriban
|
||||
namespace WireMock.Transformers.Scriban;
|
||||
|
||||
internal class ScribanContextFactory : ITransformerContextFactory
|
||||
{
|
||||
internal class ScribanContextFactory : ITransformerContextFactory
|
||||
private readonly IFileSystemHandler _fileSystemHandler;
|
||||
private readonly TransformerType _transformerType;
|
||||
|
||||
public ScribanContextFactory(IFileSystemHandler fileSystemHandler, TransformerType transformerType)
|
||||
{
|
||||
private readonly IFileSystemHandler _fileSystemHandler;
|
||||
private readonly TransformerType _transformerType;
|
||||
_fileSystemHandler = Guard.NotNull(fileSystemHandler);
|
||||
_transformerType = Guard.Condition(transformerType, t => t is TransformerType.Scriban or TransformerType.ScribanDotLiquid);
|
||||
}
|
||||
|
||||
public ScribanContextFactory(IFileSystemHandler fileSystemHandler, TransformerType transformerType)
|
||||
{
|
||||
_fileSystemHandler = Guard.NotNull(fileSystemHandler);
|
||||
_transformerType = Guard.Condition(transformerType, t => t == TransformerType.Scriban || t == TransformerType.ScribanDotLiquid);
|
||||
}
|
||||
|
||||
public ITransformerContext Create()
|
||||
{
|
||||
return new ScribanContext(_fileSystemHandler, _transformerType);
|
||||
}
|
||||
public ITransformerContext Create()
|
||||
{
|
||||
return new ScribanContext(_fileSystemHandler, _transformerType);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user