Created
June 4, 2020 13:45
-
-
Save KeesCBakker/e2b71fa26a55ef6afd863130348025f9 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 DefaultMessageService : IMessageService | |
{ | |
public string GetMessage() => "Hello world!"; | |
} | |
public class HiddenMessageService : IMessageService | |
{ | |
private readonly ISecretKey _key; | |
public HiddenMessageService(ISecretKey key) | |
{ | |
_key = key; | |
} | |
public string GetMessage() => | |
"The answer to life the universe and everything: " + | |
_key.GetKey(); | |
} | |
public interface ISecretKey | |
{ | |
public string GetKey(); | |
} | |
public class SecretKey : ISecretKey | |
{ | |
public string GetKey() => "42"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment