title: API testing using post man
body: <p>I am new to api testing from postman.I went through several blogs and articles on
  api testing.But I don't know how deeper we can done testing.
  Also how can we write test for post request.I have the below department mode class
  from my web api.</p>
  
  <pre><code>    [Key]
      public int DepartmentId { get; set; }
  
      [Required]
      [Display(Name ="Department Name")]
      public string DepartmentName { get; set; }
  
      public string Description { get; set; }
  
      public bool IsActive { get; set; }
  </code></pre>
  
  <p>The sample get request i used is given below</p>
  
  <pre><code>var body = JSON.parse(responseBody);
  if(!body.DepartmentId)
  {
  tests["department id must exists in  response"]=true;
  }
  else
  {
  tests["department id exists in response"]=true;
  }
  if(typeof body.DepartmentName !='string')
  {
  tests["department name must be type string"]=true;
  }
  if(responseCode.name.has("OK"))
  {
  tests["Status code name has string OK"] = true;
  }
  </code></pre>
  
  <p>Whether the above testing procedure is correct.?
     What all things to be tested while invoking a post request and get request against department controller for the above model.</p>