title: Unit Test - Construct URI for local file in project
body: <p>I have a service which parses JSON from an external API.</p>
  
  <p>This service does the following:</p>
  
  <ol>
  <li>Constructs a URI to the API</li>
  <li>Reads the JSON returned</li>
  <li>Deserializes into relevant C# objects</li>
  <li>Maps to my domain entities</li>
  <li>Saves to database</li>
  </ol>
  
  <p>I'm trying to unit-test steps 1-4 (5 is out of scope for this test).</p>
  
  <p>As such, i don't want to be hitting the web api - rather i have a "sample" JSON file stored locally in my test project.</p>
  
  <p>How can i read this file and construct it into a Uri object?</p>
  
  <p>e.g:</p>
  
  <pre><code>var uri = new Uri("myfile.json");
  </code></pre>
  
  <p>I'm getting an error saying "The URI is not well formed".</p>
  
  <p>The file is set to Build Action: Embedded Resource, and Copy to Output Directory: Copy always.</p>
  
  <p>I'm on C# .NET 4.5 (VS 2012), and using XUnit for my tests.</p>