Created
September 13, 2019 10:04
-
-
Save chivandikwa/31e5c2983a5a5731c235132f8e7ca331 to your computer and use it in GitHub Desktop.
Verify SimpleInjector container with diagnostics
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
[Fact] | |
public void VerifyContainerWithDiagnostics() | |
{ | |
Action containerVerificationAction = () => { | |
container.Verify(VerificationOption.VerifyAndDiagnose); | |
}; | |
containerVerificationAction.Should().NotThrow(); | |
DiagnosticResult[] res = Analyzer.Analyze(container); | |
res.Should().NotContain(result => result.Severity != DiagnosticSeverity.Information); | |
// Warnings that are ok can be suppressed on registration | |
// registration.SuppressDiagnosticWarning(DiagnosticType.DisposableTransientComponent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment