<p>My understanding is that you have to write unit tests that isolate functionality. So given a repository class that has this method:</p>

<pre><code>Entity GetById(Guid id)
</code></pre>

<p>and a <em>fake</em> implementation (using a Dictionary for storage), how would you write a test without first <em>adding</em> an entity? Is it ok to use a known set of guids for testing? Then in the fake repository constructor I could fill the dictionary with a couple of entities where the guids follow a pattern, so that I can test the GetById() method with a guid that I know will return an entity. </p>

<p>Thanks for reading!</p>

<p>PS. This is my first time writing unit tests.</p>

Yes, you could use known test ids in your test - that is what I would do.  Although I have become a fan of
Rhino Mocks
which lets you put more directly in the test about what you'd expect to the mock object to do.
For example just before your call to the repository, you would do this:
```
```
Expect.Call(repository.GetById("someObject")).Return(new RepositoryThing());
```
```
It appeals to me anyway :)