title: How do I test an Api Controller [httpget] Method, using a console application
body: <p>I am trying to test a api controller methods using a console app. I am trying to test the GetCustomerInfo method, that searches the database with the id. I can not figure out how to test the parameter that goes into the method.
  My Controller method</p>
  
  <pre><code>[Route("GETCustomerInfo/{Id}")]
  [HttpGet("{Id}")]
  public Persons GETCustomerInfo(int id)
  {
      Persons customerInfo;
      ListFromRepository.TryGetValue(id, out customerInfo);
      return customerInfo;
  }
  </code></pre>
  
  <p>My console application test method</p>
  
  <pre><code>public override async Task&lt;bool&gt; ExecuteTests()
  {
      HttpResponseMessage res =  await  HttpClientConnection.GetAsync("Default/GetCustomerInfo/Id")
      res.EnsureSuccessStatusCode();
      if(res.IsSuccessStatusCode)
      {
          return true;
      }
  }
  </code></pre>