Skip to content

Instantly share code, notes, and snippets.

@NickLarsen
Created February 3, 2012 21:17
Show Gist options
  • Save NickLarsen/1732673 to your computer and use it in GitHub Desktop.
Save NickLarsen/1732673 to your computer and use it in GitHub Desktop.
Id helper for unit testing to ensure all objects have unique ids
public static class IdHelper
{
private static int CurrentId = 0;
public static int NextId()
{
var newId = Interlocked.Increment(ref CurrentId);
return newId;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment