Created
January 30, 2015 21:05
-
-
Save kmcginnes/76d935abdd2a499fef1f to your computer and use it in GitHub Desktop.
Test the Castle Windsor Container
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 describe_ioc_container | |
{ | |
It should_be_able_to_resolve_all_registered_components = () => | |
{ | |
var bootstrapper = new AppBootstrapper(false); | |
var host = (IDiagnosticsHost) bootstrapper.Container.Kernel.GetSubSystem(SubSystemConstants.DiagnosticsKey); | |
var diagnostics = host.GetDiagnostic<IPotentiallyMisconfiguredComponentsDiagnostic>(); | |
var handlers = diagnostics.Inspect(); | |
if (handlers.Any()) | |
{ | |
var message = new StringBuilder(); | |
var inspector = new DependencyInspector(message); | |
foreach (IExposeDependencyInfo handler in handlers) | |
{ | |
handler.ObtainDependencyDetails(inspector); | |
} | |
Console.WriteLine(message); | |
message.Length.Should().Be(0); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment