Last active
June 3, 2021 09:28
-
-
Save DalSoft/8d6ff33d473894244e4a to your computer and use it in GitHub Desktop.
Introducing DalSoft.RestClient the dynamic rest client
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
dynamic client = new RestClient("http://jsonplaceholder.typicode.com"); | |
var post = new { title = "foo", body = "bar", userId = 10 }; | |
var result = await client.Posts(1).Put(post); | |
Assert.That(result.title, Is.EqualTo(post.title)); | |
Assert.That(result.body, Is.EqualTo(post.body)); | |
Assert.That(result.userId, Is.EqualTo(post.userId)); | |
Assert.That(result.HttpResponseMessage.StatusCode, Is.EqualTo(HttpStatusCode.OK)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assert.That ? Is.EqualTo?