title: 'List<Choice>' does not contain a definition for 'ChoiceId ' and no extension...are you missing a using directive or an assembly reference?)
body: <p>Title is just a part of the error, here is one of many error:</p>
  
  <blockquote>
    <p>'List' does not contain a definition for 'ChoiceId' and no extension method 'ChoiceId' accepting a first argument of type 'List' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>I am trying to unit test a list of RepaymentPlan as stated below. But I can not seem to fetch the rest of the values in that list since I get red underline error below those keys (I have wrapped those keys with ** ** in unit test below. Something wrong I am doing and not sure how to solve it.</p>
  
  <p>Still learning and fresh new to programming so hopefully you guys can guide me in the right way. Really appreciate your help.</p>
  
  <p>Here is what I have:</p>
  
  <p><strong><em>Models:</em></strong></p>
  
  <pre><code>using System.Collections.Generic;
  
  namespace Project.Models
  {
      public class Repayment
      {
        public int Amount { get; set; }
        public string DueDate { get; set; }
        public string RepaymentId { get; set; }
      }
  
     public class Choice
     {
        public string ChoiceId { get; set; }
        public List&lt;Repayment&gt; Repayments{ get; set; }
     }
  
     public class RepaymentPlan
     {
        public List&lt;Choice&gt; Choices{ get; set; }
     }
  }
  </code></pre>
  
  <hr>
  
  <p><strong><em>Repositories:</em></strong></p>
  
  <pre><code>using System.Collections.Generic;
  using System.Linq;
  using Project.Models;
  using System.Net;
  using System.Collections.Specialized;
  using System.Text;
  
  
  namespace Project.Repositories
  {
     public class OrderRepository
     {
         private static List&lt;RepaymentPlan&gt; _RepaymentPlan;
  
         static OrderRepository()
         {
             _RepaymentPlan = new List&lt;RepaymentPlan&gt;();
  
            _RepaymentPlan.Add(new RepaymentPlan 
            {
               Choices = new List&lt;Choice&gt;
                          {
                              new Choice
                              {
                                  ChoiceId = "cho1",
                                  Repayments = new List&lt;Repayment&gt;
                                                  {
                                                      new Repayment
                                                      {
                                                          Amount = 200,
                                                          DueDate = "2018-06-01"
                                                      }, 
                                                      new Repayment
                                                      {
                                                          Amount = 100,
                                                          DueDate = "2018-08-01",
                                                      }
                                                  }
                              }, 
                              new Choice
                              {
                                  ChoiceId = "cho2",
                                  Repayments = new List&lt;Repayment&gt;
                                                  {
                                                      new Repayment
                                                      {
                                                          RepaymentId = "Choice1",
                                                          Amount = 300,
                                                          DueDate = "2018-10-01"
                                                      }, 
                                                      new Repayment
                                                      {
                                                          RepaymentId = "Choice2",
                                                          Amount = 150,
                                                          DueDate = "2018-11-01"
                                                      }, 
                                                  }
                              }                                             
                          },
               });
  }
  </code></pre>
  
  <hr>
  
  <p><strong>* Unit test *</strong></p>
  
  <pre><code>[Test]
  public void ListRepaymentPlan()
  {
       // Arrange
       var controller = new CaseController();
       var expectedResult = new List&lt;RepaymentPlan&gt;();
       var repaymentPlan = new RepaymentPlan()
       {
            Choices = new List&lt;Choice&gt;
                      {
                          new Choice
                          {
                              ChoiceId = "cho1",
                              Repayments = new List&lt;Repayment&gt;
                                              {
                                                  new Repayment
                                                  {
                                                      Amount = 200,
                                                      DueDate = "2018-06-01"
                                                  }, 
                                                  new Repayment
                                                  {
                                                      Amount = 100,
                                                      DueDate = "2018-08-01"
                                                  }, 
                                              }
                         }, 
                          new Choice
                          {
                               ChoiceId = "cho2",
                               Repayments = new List&lt;Repayment&gt;
                                              {
                                                  new Repayment
                                                  {
                                                      RepaymentId = "Choice1",
                                                      Amount = 300,
                                                      DueDate = "2018-10-01"
                                                  }, 
                                                  new Repayment
                                                  {
                                                      RepaymentId = "Choice2",
                                                      Amount = 150,
                                                      DueDate = "2018-11-01"
                                                  }, 
                                              }
                          }                                             
                      },
  
              };
              expectedResult.Add(RepaymentPlan );
  
       // Act
       var actionResult = controller.FindRepaymentPlan("578", "156");
       var result = (List&lt;RepaymentPlan &gt;)actionResult;
  
       // Assert
       for (var i = 0; i &lt; result.Count; i++)
       {
           Assert.AreEqual(expectedResult[i].Choices , result[i].Choices);
           Assert.AreEqual(expectedResult[i].Choices.**ChoiceId**, result[i].Choices.**ChoiceId**);
           Assert.AreEqual(expectedResult[i].Choices.**ChoiceId**.Repayments, result[i].Choices.**ChoiceId**.Repayments);
           Assert.AreEqual(expectedResult[i].Choices.**Repayments**.Amount, result[i].Choices.**Repayments**.Amount);
           Assert.AreEqual(expectedResult[i].Choices.**Repayments**.DueDate, result[i].Choices.**Repayments**.DueDate);
       }
   }
  </code></pre>
  
  <hr>
  
  <p>** Updated unit test **</p>
  
  <pre><code>        // Assert
          for (var i = 0; i &lt; result.Count; i++)
          {
              CollectionAssert.AreEqual(expectedResult[i].Choices, result[i].Choices);
              CollectionAssert.AreEqual(expectedResult[i].Choices[0].ChoiceId, result[i].Choices[0].ChoiceId);
              CollectionAssert.AreEqual(expectedResult[i].Choices[0].Repayments, result[i].Choices[0].Repayments);
              CollectionAssert.AreEqual(expectedResult[i].Choices, result[i].Choices);
              CollectionAssert.AreEqual(expectedResult[i].Choices[1].ChoiceId, result[i].Choices[1].ChoiceId);
              CollectionAssert.AreEqual(expectedResult[i].Choices[1].Repayments, result[i].Choices[1].Repayments);
          }
  </code></pre>