-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking changes in GetAlternateLookup
- Loading branch information
ladeak
committed
Sep 18, 2024
1 parent
4eb8c4c
commit 2d1da1a
Showing
3 changed files
with
21 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,8 @@ public void SingleSubstitution(string input, string expected) | |
{ | ||
{ "host", "localhost" } | ||
}; | ||
var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup<string, string, ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<string, VariablePostProcessingWriterStrategy, ReadOnlySpan<char>>()); | ||
var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup<ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<ReadOnlySpan<char>>()); | ||
Assert.Equal(expected, result); | ||
} | ||
|
||
|
@@ -41,8 +41,8 @@ public void NoSubstitution(string input, string expected) | |
{ | ||
{ "host", "localhost" } | ||
}; | ||
var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup<string, string, ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<string, VariablePostProcessingWriterStrategy, ReadOnlySpan<char>>()); | ||
var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup<ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<ReadOnlySpan<char>>()); | ||
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<string, string, ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<string, VariablePostProcessingWriterStrategy, ReadOnlySpan<char>>()); | ||
var result = VariablePreprocessor.Evaluate(input, variables.GetAlternateLookup<ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<ReadOnlySpan<char>>()); | ||
Assert.Equal(expected, result); | ||
} | ||
|
||
|
@@ -71,8 +71,8 @@ public void EnvironmentVariable() | |
{ | ||
{ "host", "{{$envVarHost}}" } | ||
}; | ||
var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup<string, string, ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<string, VariablePostProcessingWriterStrategy, ReadOnlySpan<char>>()); | ||
var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup<ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<ReadOnlySpan<char>>()); | ||
Assert.Equal("https://localhost/", result); | ||
} | ||
|
||
|
@@ -84,8 +84,8 @@ public void InlineReplacementFromValues() | |
{ "something", "localhost" }, | ||
{ "host", "{{ something }}" } | ||
}; | ||
var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup<string, string, ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<string, VariablePostProcessingWriterStrategy, ReadOnlySpan<char>>()); | ||
var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup<ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<ReadOnlySpan<char>>()); | ||
Assert.Equal("https://localhost/", result); | ||
} | ||
|
||
|
@@ -98,8 +98,8 @@ public void InlinedReplacementFromValues() | |
{ "someOtherVariable", "localhost" }, | ||
{ "host", "{{$ envVarHost }}" } | ||
}; | ||
var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup<string, string, ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<string, VariablePostProcessingWriterStrategy, ReadOnlySpan<char>>()); | ||
var result = VariablePreprocessor.Evaluate("https://{{host}}/", variables.GetAlternateLookup<ReadOnlySpan<char>>(), | ||
new Dictionary<string, VariablePostProcessingWriterStrategy>(StringComparer.Ordinal).GetAlternateLookup<ReadOnlySpan<char>>()); | ||
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<string, string>(StringComparer.Ordinal).GetAlternateLookup<string, string, ReadOnlySpan<char>>(), | ||
responses.GetAlternateLookup<string, VariablePostProcessingWriterStrategy, ReadOnlySpan<char>>()); | ||
var result = VariablePreprocessor.Evaluate("https://{{first.response.body.$.Data}}/", new Dictionary<string, string>(StringComparer.Ordinal).GetAlternateLookup<ReadOnlySpan<char>>(), | ||
responses.GetAlternateLookup<ReadOnlySpan<char>>()); | ||
Assert.Equal("https://hello/", result); | ||
} | ||
|
||
|
@@ -131,8 +131,8 @@ public async Task BodyFilterParse() | |
{ "first", responseWriter } | ||
}; | ||
var result = VariablePreprocessor.Evaluate("https://{{first.response.body.$.Data[[email protected]<1].Name}}/", | ||
new Dictionary<string, string>(StringComparer.Ordinal).GetAlternateLookup<string, string, ReadOnlySpan<char>>(), | ||
responses.GetAlternateLookup<string, VariablePostProcessingWriterStrategy, ReadOnlySpan<char>>()); | ||
new Dictionary<string, string>(StringComparer.Ordinal).GetAlternateLookup<ReadOnlySpan<char>>(), | ||
responses.GetAlternateLookup<ReadOnlySpan<char>>()); | ||
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<string, string>(StringComparer.Ordinal).GetAlternateLookup<string, string, ReadOnlySpan<char>>(), | ||
responses.GetAlternateLookup<string, VariablePostProcessingWriterStrategy, ReadOnlySpan<char>>()); | ||
new Dictionary<string, string>(StringComparer.Ordinal).GetAlternateLookup<ReadOnlySpan<char>>(), | ||
responses.GetAlternateLookup<ReadOnlySpan<char>>()); | ||
Assert.Equal("value-application/json", result); | ||
} | ||
} |