using System.Threading.Tasks;
using DalSoft.RestClient;
using Newtonsoft.Json.Serialization;
public async static Task Main()
var client = new RestClient("https://jsonplaceholder.typicode.com", new Config()
.SetJsonSerializerSettings(new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }));
.Resource("users/1").Get()
.Verify(user => user.username == "Fail")
.OnVerifyFailed<HttpResponseMessage>((aggregateException, response) =>
Console.WriteLine(aggregateException.InnerExceptions.Count);
}, throwOnVerifyFailed: false)
.Verify<HttpResponseMessage>(response => response.StatusCode == HttpStatusCode.BadRequest)
.OnVerifyFailed<HttpResponseMessage>((aggregateException, response) =>
Console.WriteLine(aggregateException.InnerExceptions.Count);
}, throwOnVerifyFailed: true)
.Verify(response => response.username == "Peter")
.OnVerifyFailed((aggregateException, response) =>
Console.WriteLine(aggregateException.InnerExceptions.Count);
}, throwOnVerifyFailed: true);