diff --git a/src/CHttpExecutor/ExecutionPlanBuilder.cs b/src/CHttpExecutor/ExecutionPlanBuilder.cs index 22db9ef..6867fdb 100644 --- a/src/CHttpExecutor/ExecutionPlanBuilder.cs +++ b/src/CHttpExecutor/ExecutionPlanBuilder.cs @@ -249,7 +249,7 @@ private void ValidateVariableExistance(ReadOnlySpan source) // .Where(x => !_variables.Contains(x)) // .Where(x => !_steps.Any(s => s.Name != null && x.StartsWith(s.Name))) // .Where(x => !(_currentStep.Name != null && x.StartsWith(_currentStep.Name))).FirstOrDefault(); - var variablesLookup = _variables.GetAlternateLookup>(); + var variablesLookup = _variables.GetAlternateLookup>(); foreach (Range varNameRange in VariablePreprocessor.GetVariableNameRanges(source)) { bool matched = false; diff --git a/src/CHttpExecutor/Executor.cs b/src/CHttpExecutor/Executor.cs index 3873331..b4c76e1 100644 --- a/src/CHttpExecutor/Executor.cs +++ b/src/CHttpExecutor/Executor.cs @@ -15,9 +15,9 @@ public ExecutionContext() { // TODO: Drop StringComparer.Ordinal .NET 9 https://github.com/dotnet/runtime/issues/27229 VariableValues = new(StringComparer.Ordinal); - VariableValuesLookup = VariableValues.GetAlternateLookup>(); + VariableValuesLookup = VariableValues.GetAlternateLookup>(); ExecutionResults = new(StringComparer.Ordinal); - ExecutionResultsLookup = ExecutionResults.GetAlternateLookup>(); + ExecutionResultsLookup = ExecutionResults.GetAlternateLookup>(); } public IFileSystem FileSystem { get; } = new MemoryFileSystem(); diff --git a/tests/CHttpExecutor.Tests/VariablePreprocessorTests.cs b/tests/CHttpExecutor.Tests/VariablePreprocessorTests.cs index 660b29a..d6d2688 100644 --- a/tests/CHttpExecutor.Tests/VariablePreprocessorTests.cs +++ b/tests/CHttpExecutor.Tests/VariablePreprocessorTests.cs @@ -20,8 +20,8 @@ public void SingleSubstitution(string input, string expected) { { "host", "localhost" } }; - var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup>(), - new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); + var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup>(), + new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); Assert.Equal(expected, result); } @@ -41,8 +41,8 @@ public void NoSubstitution(string input, string expected) { { "host", "localhost" } }; - var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup>(), - new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); + var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup>(), + new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); Assert.Equal(expected, result); } @@ -58,8 +58,8 @@ public void MultiSubstitution(string input, string expected) { "host", "localhost" }, { "port", "5000" } }; - var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup>(), - new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); + var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup>(), + new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); Assert.Equal(expected, result); } @@ -71,8 +71,8 @@ public void EnvironmentVariable() { { "host", "{{$envVarHost}}" } }; - var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup>(), - new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); + var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup>(), + new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); Assert.Equal("https://localhost/", result); } @@ -84,8 +84,8 @@ public void InlineReplacementFromValues() { "something", "localhost" }, { "host", "{{ something }}" } }; - var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup>(), - new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); + var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup>(), + new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); Assert.Equal("https://localhost/", result); } @@ -98,8 +98,8 @@ public void InlinedReplacementFromValues() { "someOtherVariable", "localhost" }, { "host", "{{$ envVarHost }}" } }; - var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup>(), - new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); + var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup>(), + new Dictionary(StringComparer.Ordinal).GetAlternateLookup>()); Assert.Equal("https://localhost/", result); } @@ -114,8 +114,8 @@ public async Task BodyParse() { { "first", responseWriter } }; - var result = VariablePreprocessor.Evaluate("https://{{first.response.body.$.Data}}/", new Dictionary(StringComparer.Ordinal).GetAlternateLookup>(), - responses.GetAlternateLookup>()); + var result = VariablePreprocessor.Evaluate("https://{{first.response.body.$.Data}}/", new Dictionary(StringComparer.Ordinal).GetAlternateLookup>(), + responses.GetAlternateLookup>()); Assert.Equal("https://hello/", result); } @@ -131,8 +131,8 @@ public async Task BodyFilterParse() { "first", responseWriter } }; var result = VariablePreprocessor.Evaluate("https://{{first.response.body.$.Data[?@.Val<1].Name}}/", - new Dictionary(StringComparer.Ordinal).GetAlternateLookup>(), - responses.GetAlternateLookup>()); + new Dictionary(StringComparer.Ordinal).GetAlternateLookup>(), + responses.GetAlternateLookup>()); Assert.Equal("https://test0/", result); } @@ -152,8 +152,8 @@ public async Task Header() { "first", responseWriter } }; var result = VariablePreprocessor.Evaluate("{{first.response.Headers.my}}{{first.response.headers.content-type}}", - new Dictionary(StringComparer.Ordinal).GetAlternateLookup>(), - responses.GetAlternateLookup>()); + new Dictionary(StringComparer.Ordinal).GetAlternateLookup>(), + responses.GetAlternateLookup>()); Assert.Equal("value-application/json", result); } }