feat(Tests.Client.BaseHttpClientServiceTests): Test für Abfrageparameter hinzugefügt
This commit is contained in:
@@ -21,7 +21,7 @@ namespace DigitalData.Core.Tests.Client
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task FetchJsonAsync_ShouldReturnJsonResponse()
|
||||
public async Task FetchJsonAsync_ShouldReturnJsonResponse_WithCorrectWithPath()
|
||||
{
|
||||
// Act
|
||||
var expectedUserId = (int) await _service.FetchAsync(path: "/1", sendWithCookie: false, saveCookie: false)
|
||||
@@ -31,5 +31,22 @@ namespace DigitalData.Core.Tests.Client
|
||||
// Assert
|
||||
Assert.That(expectedUserId, Is.EqualTo(1), "The userId of the fetched JSON object should be 1.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task FetchJsonAsync_ShouldReturnJsonResponse_WithQueryParams()
|
||||
{
|
||||
var queryParams = new Dictionary<string, string>
|
||||
{
|
||||
{ "userId", "1" }
|
||||
};
|
||||
|
||||
// Act
|
||||
var expectedUserId = (int)await _service.FetchAsync(queryParams: queryParams, sendWithCookie: false, saveCookie: false)
|
||||
.ThenAsync(res => res.Json())
|
||||
.ThenAsync(todo => todo.userId);
|
||||
|
||||
// Assert
|
||||
Assert.That(expectedUserId, Is.EqualTo(1), "The userId of the fetched JSON object should be 1.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user