Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Source/aweXpect.Json/Helpers/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ public static string TrimCommonWhiteSpace(this string value)
sb.Append(lines[0]);
foreach (string? line in lines.Skip(1))
{
#if NET8_0_OR_GREATER
sb.Append('\n').Append(line.AsSpan(commonWhiteSpace.Length));
#else
sb.Append('\n').Append(line.Substring(commonWhiteSpace.Length));
#endif
Comment on lines +53 to +57
}

return sb.ToString();
Expand Down
4 changes: 4 additions & 0 deletions Source/aweXpect.Json/Json/ExpectationJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ public bool TryGetExpectation(JsonElement element,
{
string? value = element.GetString();
if (value?.StartsWith(Prefix) == true &&
#if NET8_0_OR_GREATER
Guid.TryParse(value.AsSpan(Prefix.Length), out Guid guid) &&
#else
Guid.TryParse(value.Substring(Prefix.Length), out Guid guid) &&
#endif
_expectations.TryGetValue(guid, out Expectation? expectation) &&
expectation is IOptionsProvider<ExpectationBuilder>
{
Expand Down
Loading