Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Aug 1, 2024
1 parent 6d55b26 commit 6fb6fd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/MediatR.CommandQuery/Services/QueryStringEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static class QueryStringEncoder
return Base64UrlEncode(jsonBytes);
}

public static T? Decode<T>(string encodedQueryString, JsonSerializerOptions? jsonSerializerOptions = null)
public static T? Decode<T>(string? encodedQueryString, JsonSerializerOptions? jsonSerializerOptions = null)
{
if (string.IsNullOrWhiteSpace(encodedQueryString))
return default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void EncodeEntitySelect()
};

var queryString = QueryStringEncoder.Encode(entitySelect);
queryString.Should().Be("CzsAAASe5889-eEHdHnRNvqRiyjYgBPCSHNOZNb72k7Uz0E3Rf2G1FNZKoamH5HbQf2pIoSw_X_G6I-iURkQtGj4RfU_qxOuhyLOyjHqEdIuoPiPR9Mj2EMwlSXXZQA");
queryString.Should().NotBeNullOrWhiteSpace();

var resultSelect = QueryStringEncoder.Decode<EntitySelect>(queryString);
resultSelect.Should().NotBeNull();
Expand All @@ -23,5 +23,8 @@ public void EncodeEntitySelect()
resultSelect.Filter.Operator.Should().Be("IsNull");

resultSelect.Sort.Should().NotBeNullOrEmpty();
resultSelect.Sort[0].Name.Should().Be("Updated");
resultSelect.Sort[0].Direction.Should().Be("Descending");

}
}

0 comments on commit 6fb6fd2

Please sign in to comment.