title: Call JSON C# classes into a method
body: <p>I have a JSON API like this, </p>
  
  <pre><code>{
   "pokemon": {
   "currentPokemon": 1,
   "total": 1,
   "totalCount": 1,
   },
  "collections": [
  {
    "pokemonId": 2310,
    "pokemonName": "Pikachu",
    "pokemonType": "Land",
    "status": {
      "Active": "YES",
      "Holder": "ASH"
    },
    "power": {
      "Type": 10,
      "name": "Thunder"
    },
  
  }
  ]
  }
  </code></pre>
  
  <p>And I have the C# Classes for those API</p>
  
  <pre><code>Public ClassPokemonster 
  {
  
  public class RootObject
  {
   [JsonProperty("pokemon")]
   public Pokemon Pokemon { get; set; }
   [JsonProperty("collections")]
   public List&lt;Collection&gt; Collections { get; set; }
  }
  public class Pokemon
  {
   [JsonProperty("currentPokemon")]
   public int CurrentPokemon { get; set; }
   [JsonProperty("total")]
   public int Total { get; set; }
   [JsonProperty("totalCount")]
   public int TotalCount { get; set; }
  }
  public class Collection
  {
   [JsonProperty("pokemonId")]
   public int PokemonId { get; set; }
   [JsonProperty("pokemonName")]
   public string PokemonName { get; set; }
   [JsonProperty("pokemonType")]
   public string PokemonType { get; set; }
   [JsonProperty("status")]
   public Status Status { get; set; }
   [JsonProperty("power")]
  public Power Power { get; set; }
  }
  public class Status
  {
   [JsonProperty("Active")]
   public string Active { get; set; }
   [JsonProperty("Holder")]
   public string Holder { get; set; }
  }
  public class Power 
  {
   [JsonProperty("Type")]
   public int Type { get; set; }
   [JsonProperty("name")]
   public string Name { get; set; }
  }
  }
  </code></pre>
  
  <p>And I'm trying to assert those values matching the API values using this method</p>
  
  <pre><code>         Driver.Instance.Navigate().GoToUrl(url);
          //WebRequest
          HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(url);
          getRequest.Method = "GET";
  
          var getResponse = (HttpWebResponse)getRequest.GetResponse();
          Stream newStream = getResponse.GetResponseStream();
          StreamReader sr = new StreamReader(newStream);
  
          //Deserialize JSON results
          var result = sr.ReadToEnd();
          Pokemonster deserializedObjects = JsonConvert.DeserializeObject&lt;Pokemonster&gt;(result);
  </code></pre>
  
  <p>I'm trying to assert in this way,</p>
  
  <pre><code>  Assert.Equal("2310", deserializedObject.Collections.PokemonId.ToString());
  </code></pre>
  
  <p>My assert doesn't fetch the values inside the <code>collections</code> class such as <code>pokemonoId</code> <code>pokemonName</code>and so on! </p>
  
  <p>Help me getting through this! </p>