Skip to content

Commit

Permalink
Upgrade the Std.UriTemplate lib to 0.54 and add a unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist committed Mar 8, 2024
1 parent e95b9a7 commit 936d415
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Microsoft.Kiota.Abstractions.Tests/RequestInformationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ namespace Microsoft.Kiota.Abstractions.Tests
{
public class RequestInformationTests
{
[Fact]
public void SetUriCorrectlyEscapesDataString()
{
// Arrange
var testRequest = new RequestInformation()
{
HttpMethod = Method.GET,
UrlTemplate = "http://localhost/repos/{owner}/{repo}/labels/{name}"
};
// Act
testRequest.PathParameters.Add("owner", "me");
testRequest.PathParameters.Add("repo", "test");
testRequest.PathParameters.Add("name", "profane content 🤬");
// Assert
var actual = testRequest.URI.AbsoluteUri.ToString();
Assert.Equal("http://localhost/repos/me/test/labels/profane%20content%20%F0%9F%A4%AC", actual);
Assert.Empty(testRequest.QueryParameters);
}
[Fact]
public void SetUriExtractsQueryParameters()
{
Expand Down

0 comments on commit 936d415

Please sign in to comment.