Skip to content

Instantly share code, notes, and snippets.

@jchannon
Created July 4, 2012 12:42
Show Gist options
  • Select an option

  • Save jchannon/3047138 to your computer and use it in GitHub Desktop.

Select an option

Save jchannon/3047138 to your computer and use it in GitHub Desktop.
TDD/IOC Help
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