Skip to content

Instantly share code, notes, and snippets.

@DalSoft
Last active June 3, 2021 09:28
Show Gist options
  • Save DalSoft/8d6ff33d473894244e4a to your computer and use it in GitHub Desktop.
Save DalSoft/8d6ff33d473894244e4a to your computer and use it in GitHub Desktop.
Introducing DalSoft.RestClient the dynamic rest client
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));
@kiquenet
Copy link

kiquenet commented Jun 3, 2021

Assert.That ? Is.EqualTo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment