Created
April 13, 2016 14:32
-
-
Save mattbrailsford/d316f7e4346ddc2b3b1882092fbb3266 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 IDictionaryValueResolver | |
{ | |
public string ResolveValue(string key); | |
} | |
public class ConcreteDictionaryValueResolver : IDictionaryValueResolver | |
{ | |
public string ResolveValue(string key) { | |
// Do your thing | |
} | |
} | |
public class MockDictionaryValueResolver : IDictionaryValueResolver | |
{ | |
public string ResolveValue(string key) { | |
// Do your thing | |
} | |
} | |
public class DictionaryValueResolverFactory { | |
private static IDictionaryValueResolver _resolver; | |
public static IDictionaryValueResolver Get() | |
{ | |
if(_resolver == null) { | |
_resolver = new ConcreteDictionaryValueResolver(); | |
} | |
return _resolver; | |
} | |
internal static Set(IDictionaryValueResolver value) { | |
_resolver = value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment