title: Unit testing fundaments question about collections and their Add, Remove, ... methods
body: <p>I read this <a href="https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices" rel="nofollow noreferrer">article</a> about best practices in unit tests, but I still don't get one thing. When I have a <code>List&lt;T&gt;</code> or another collection and then use <code>.Add</code> or <code>.Remove</code> method to add/remove elements, does it count as an <em>arrange</em> or an <em>act</em>?</p>
  
  <p>For example, this definitely counts as <em>arrange</em>:</p>
  
  <pre class="lang-cs prettyprint-override"><code>List&lt;decimal&gt; values = new List&lt;decimal&gt;
  {
      0.01668m,
      0.01666m
  };
  </code></pre>
  
  <p>Consider the following examples:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class IndicatorTests
  {
      [Fact]
      public void SimpleMovingAverage_MultipleCloseValues_ReturnsSMA()
      {
          // Arrange
          SimpleMovingAverage sma = new SimpleMovingAverage(5);
  
          // Act
          sma.Add(0.01692m);
          sma.Add(0.01685m);
          sma.Add(0.01686m);
          sma.AddRange(new List&lt;decimal&gt;
          {
              0.01668m,
              0.01666m
          });
          decimal actual = sma.GetResult();
  
          // Assert
          Assert.Equal(0.016794m, actual);
      }
  
      [Fact]
      public void SimpleMovingAverageBuilder_MultipleCloseValues_ReturnsSMA()
      {
          // Arrange
          SimpleMovingAverage sma = new SimpleMovingAverageBuilder(5)
              .Add(0.01692m)
              .Add(0.01685m)
              .Add(0.01686m)
              .Add(0.01668m)
              .Add(0.01666m)
              .Build();
  
          // Act
          decimal actual = sma.GetResult();
  
          // Assert
          Assert.Equal(0.016794m, actual);
      }
  }
  </code></pre>
  
  <p>I believe the second test is okay convention-wise. What about the first one?</p>
  
  <p>Should I do it like that:</p>
  
  <pre class="lang-cs prettyprint-override"><code>[Fact]
  public void SimpleMovingAverage_MultipleCloseValues_ReturnsSMA()
  {
      // Arrange
      SimpleMovingAverage sma = new SimpleMovingAverage(5);
      List&lt;decimal&gt; values = new List&lt;decimal&gt;
      {
          0.01668m,
          0.01666m
      };
  
      // Act
      sma.Add(0.01692m);
      sma.Add(0.01685m);
      sma.Add(0.01686m);
      sma.AddRange(values);
      decimal actual = sma.GetResult();
  
      // Assert
      Assert.Equal(0.016794m, actual);
  }
  </code></pre>
  
  <p>Or so:</p>
  
  <pre class="lang-cs prettyprint-override"><code>[Fact]
  public void SimpleMovingAverage_MultipleCloseValues_ReturnsSMA()
  {
      // Arrange
      SimpleMovingAverage sma = new SimpleMovingAverage(5);
      List&lt;decimal&gt; values = new List&lt;decimal&gt;
      {
          0.01668m,
          0.01666m
      };
  
      sma.Add(0.01692m);
      sma.Add(0.01685m);
      sma.Add(0.01686m);
      sma.AddRange(values);
  
      // Act
      decimal actual = sma.GetResult();
  
      // Assert
      Assert.Equal(0.016794m, actual);
  }
  </code></pre>
  
  <p>Which one is better? Please elaborate your answer.</p>