title: Mock Elastic Search response in.Net
body: <p>I have Elastic Search Nest library code and need to mock the response i am getting from elastic search index.</p>
  
  <pre><code>var obj = service.Search&lt;TestDocument&gt;(new student().Query());
  var Name= obj.Aggs.Terms("Name");
  </code></pre>
  
  <p>For Testing :
  I am creating the Nest object after doing quick watch but facing issue -<strong>Aggregations</strong> - is a internal protected property and i am not able to set this value.</p>
  
  <pre><code>                           new Nest.KeyedBucket&lt;object&gt;
                             {   
                                 Key="XYZ school",
                                 KeyAsString=null,
                                 Aggregations=new Dictionary&lt;string, IAggregationContainer&gt;{}
                             }
  </code></pre>
  
  <p>Please suggest solution or any other approach i can use to mock elastic search nest object .</p>