Nov 12

Want to learn how test your REST API fluently in a couple of lines of C# code?

Like this:

public async Task Get_UserWithId1_ReturnsDynamicWithUsernameBretAndOkStatusCode()
   var client = new RestClient("", new Config()
                .SetJsonSerializerSettings(new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }));

   await client
      .Verify(userIsBret => userIsBret.username == "Bret")
      .Verify(httpResponseMessageIsOk => httpResponseMessageIsOk.HttpResponseMessage.StatusCode == HttpStatusCode.OK);

View live example

Head over to my post on Code Maze, and your be testing REST API’s using C# in no time at all.

Tagged with:
preload preload preload