Created
July 4, 2012 12:42
-
-
Save jchannon/3047138 to your computer and use it in GitHub Desktop.
TDD/IOC Help
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 ISomething | |
| { | |
| void DoSomething(); | |
| } | |
| public class SomethingA : ISomething | |
| { | |
| public void DoSomething() | |
| { | |
| } | |
| } | |
| public class SomethingAB : ISomething | |
| { | |
| public void DoSomething() | |
| { | |
| } | |
| } | |
| public class Different | |
| { | |
| private ISomething ThisSomething; | |
| public Different(ISomething Something) | |
| { | |
| ThisSomething = Something; | |
| } | |
| } | |
| //NOTES: In some circumstances in your app you may want SomethingA to be used in class Different and sometimes SomethingAB. How do you tell the IOC when to use the relevant class? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment