Created
December 2, 2017 19:22
-
-
Save 15mgm15/e34d09f795e50606b1dea9899a52bf58 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 class DependencyServiceStub : IDependencyService | |
{ | |
readonly Dictionary<Type, object> registeredServices = new Dictionary<Type, object>(); | |
public void Register<T>(object impl) | |
{ | |
registeredServices[typeof(T)] = impl; | |
} | |
public T Get<T>() where T : class | |
{ | |
var service = (T)registeredServices[typeof(T)]; | |
return service; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment