Created
June 9, 2013 15:20
-
-
Save thefringeninja/5743904 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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