title: Are Integration Tests asynchronously (using C# code) in VS2010 when debug code?
body: <p>I have met the following problem regarding the integration tests.</p>
  
  <p>The code (simple using some other functions). I have put breakpoint on <code>AddItem</code> function.</p>
  
  <pre><code>[TestInitialize]
        public void MyTestInitialize() {
           Assert.IsTrue( AddItem() );
        }
  
   [TestCleanup]
        public void MyTestCleanup() {
           Assert.IsTrue( RemoveItem() );
        }
  
  [TestMethod]
  public void ListTest(){
     AClass test = new AClass();
     Assert.IsTrue(test.List().Count &gt; 0);
  }
  
  private bool AddItem() {
    AClass obj = new AClass();
  
    Assert.IsTrue(obj.Add("test", "123")); //no duplicate will be allowed ! (return false if duplicate found)
  
    obj.Files = ConstructFiles();
    ...
    ...
  }
  
  private string[] ConstructFiles(){
    return Directory.GetFiles(@"/folder/files", "*.doc"); 
      //when execute the above code then the breakpoint from `AddItem` is reached !!!
  }
  </code></pre>
  
  <p>When testing <code>ListTest</code> will automatically call <code>AddItem</code> (because of <code>TestInitialize</code> attribute).</p>
  
  <p>First call is ok but when this function(<code>AddItem</code>) call another function <code>ConstructFiles</code> then the breakpoint for <code>AddItem</code> is reached and execute again the function.</p>
  
  <p>Why ?</p>
  
  <p>Of course, I have another tests using <code>TestMethod</code> attribute but something is unclear when call first time <code>AddItem</code> and it calls <code>ConstructFiles</code>.</p>