title: Unit Test Assets in TFS 2010 Build
body: <p>I have a unit test that looks at a text file included in my test project.  I had to take this route, as I can't seem to properly duplicate the special characters in a C# string that the users are getting into the raw data itself (some other system).</p>
  
  <p>The unit test reads the content of the file during the arrange portion, then acts on the content to ensure things are working as planned.</p>
  
  <p>Locally, the test runs just fine--zero issues.</p>
  
  <p>We run TFS2010 Build, and my builds fail that test every time, as the text file itself isn't found when the test is run on the build server.</p>
  
  <p>My file is presently in a directory on the Test project itself called "Assets", the text file's properties are:</p>
  
  <ul>
  <li>Build Action: Content</li>
  <li>Copy To Output Directory: Copy Always</li>
  </ul>
  
  <p>The Test Code is</p>
  
  <pre><code>    [TestMethod]
      public void Broken_First_Token_Ok_Second_Returns_Full_String()
      {
          string rawText = string.Empty;
  
          // load the broken translation
          using (StreamReader reader = new StreamReader(@"Assets\BrokenTranslation.txt")){
              rawText = reader.ReadToEnd();
          }
  
          string expected = rawText;
  
          string actual = [Some code that should return the proper values]
  
          Assert.AreEqual(expected, actual, "Failed to return proper match");
  
      }
  </code></pre>
  
  <p>What have I missed?</p>