Skip to content

Instantly share code, notes, and snippets.

@MrCoder
Last active December 28, 2017 01:32
Show Gist options
  • Save MrCoder/9159fef8244b72331b49772920285490 to your computer and use it in GitHub Desktop.
Save MrCoder/9159fef8244b72331b49772920285490 to your computer and use it in GitHub Desktop.
// API client interface
public interface IMyApiClient
{
[Get("/status")]
Task<string> GetStatus();
}
// Test code
[Fact]
public async Task Get_status()
{
var myApiClient = RestService.For<IMyApiClient>("http://localhost:1080");
var status = await myApiClient.GetStatus();
Assert.Equal("OK", status);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment