Created
March 19, 2012 13:29
-
-
Save jbogard/2112149 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 abstract class TestClassBase | |
{ | |
private readonly IContainer _container | |
= Root.Container.GetNestedContainer(); | |
protected T GetInstance<T>() | |
{ | |
return _container.GetInstance<T>(); | |
} | |
protected void Inject<T>(T instance) | |
{ | |
_container.Configure(cfg => cfg.For<T>().Use(instance)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment