Skip to content

Instantly share code, notes, and snippets.

@thefringeninja
Created June 9, 2013 15:20
Show Gist options
  • Save thefringeninja/5743904 to your computer and use it in GitHub Desktop.
Save thefringeninja/5743904 to your computer and use it in GitHub Desktop.
public interface ICheckRequests
{
bool IsLocal();
}
public class ProductionRequestChecker : ICheckRequests
{
public bool IsLocal()
{
return HttpContext.Current.Request.IsLocal;
}
}
// this goes in your tests assembly. or you can use moq
public class NotLocalFakeRequestChecker : ICheckRequests
{
public bool IsLocal()
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment