title: How do I put new List<int> {1} in an NUNIT TestCase?
body: <p>I have the method:</p>
  
  <pre><code>public static int Add(List&lt;int&gt; numbers)
      {
          if (numbers == null || numbers.Count == 0)
              return 0;
  
          if (numbers.Count == 1)
              return numbers[0];
  
  
          throw new NotImplementedException();
      }
  </code></pre>
  
  <p>Here is my test against it, but it does not like <code>new List&lt;int&gt; {1}</code> in the TestCase:</p>
  
  <pre><code>    [TestCase(new List&lt;int&gt;{1}, 1)]
      public void Add_WithOneNumber_ReturnsNumber(List&lt;int&gt; numbers)
      {
  
          var result = CalculatorLibrary.CalculatorFunctions.Add(numbers);
  
          Assert.AreEqual(1, result);
      }
  </code></pre>
  
  <p>It gives me the error:</p>
  
  <p><code>An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type</code></p>
  
  <p>Do I have to do it like this:</p>
  
  <pre><code>    [Test]
      public void Add_WithOneNumber_ReturnsNumber()
      {
  
          var result = CalculatorLibrary.CalculatorFunctions.Add(new List&lt;int&gt;{7});
  
  
          Assert.AreEqual(7, result);
  
          var result2 = CalculatorLibrary.CalculatorFunctions.Add(new List&lt;int&gt; {3});
  
          Assert.AreEqual(4,result2);
      }
  </code></pre>