Setting up an API Test Framework

  • I'm testing an API and I'm looking to define my payload using classes so that my program can then deserialize/serialize into any format (namely XML in my case). Below is an example of the payload:

             <Item IsKit="false">
           <Item IsKit="false">
         <TimeStamp>2017-03-30 00:00:00.102</TimeStamp>

    So my thinking is that I would have an overall Order class which looks something like the below

    public class Order()
          BillingAddress bAddr; //another class
          List Items;
          double OrderAmount;
          DateTime TimeStamp;

    What I am trying to work out is the best way of setting up my framework so that in the example of the BillingAddress class I can set up a series of properties e.g. AddressLine1/AddressLine1 etc which can then be called when I run the test

    Any advice on how to structure the test framework would be most appreciated

  • I’m not sure how it works in C# but you may use the optional arguments. Also I would recommend to create a models of your payloads. - models -> - xml - xml then pass this file as your payload. In your case it’s XML and for example interface.

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2