title: How to test a list as result of a function in C#
body: <p>For my company I'm creating an Azure Functions with .NET Core 3.x to generate the invoices. I have to consider different scenarios and I want to create a test for that.</p>
  <p>I thought to create a function where I pass a list of lines for the invoice. In this function I have to check if there is any refund for the user: if so, I have to deduct the amount from the current invoice. If some money to refund are left, I have to create a new refund invoice.</p>
  <pre><code>public class InvoiceGeneratorResponse
  {
      public List&lt;InvoiceGeneratorDetailResponse&gt; Details { get; set; }
      public List&lt;InvoiceGeneratorErrorResponse&gt; Errors { get; set; }
      public List&lt;InvoiceGeneratorNextInvoiceResponse&gt; NextInvoice { get; set; }
  }
  </code></pre>
  <p><em>InvoiceGeneratorResponse</em> is the result of my class where <em>Details</em> is the invoice list, <em>Errors</em> is the list of incomplete invoices and <em>NextInvoice</em> is the list of refund invoices I have to create.</p>
  <p>Now, I want to create a bunch of tests to check every scenario. For that, I have to pass the list of rows to this function and check the result.</p>
  <p>I was thinking to read the list of rows from a <code>json</code> file and convert it in a list to pass into the function. For the result I want to read another file, convert it in a list and compare the list from the file with the result from the function.</p>
  <p>Is there already an <strong>annotation</strong> for reading a file in a test? If yes, with what framework? <code>xUnit</code>? <code>nUnit</code>? Is there an easy way to fully compare two lists in a test?</p>