diff --git a/src/Simplify.DI.Tests/DIContainerProviderTests.cs b/src/Simplify.DI.Tests/DIContainerProviderTests.cs index a22a8383..ab948725 100644 --- a/src/Simplify.DI.Tests/DIContainerProviderTests.cs +++ b/src/Simplify.DI.Tests/DIContainerProviderTests.cs @@ -24,7 +24,7 @@ public void Resolve_NotRegistered_ContainerException() // Act & Assert var ex = Assert.Throws(() => _provider.Resolve()); - Assert.That(ex.Message, Does.StartWith("Unable to resolve")); + Assert.That(ex.Message, Does.StartWith("code: UnableToResolveUnknownService")); Assert.That(ex.Message, Does.Contain("NonDepFoo (IsResolutionCall)")); } @@ -35,7 +35,7 @@ public void ScopedResolve_NotRegistered_ContainerException() using (var scope = _provider.BeginLifetimeScope()) { var ex = Assert.Throws(() => scope.Resolver.Resolve()); - Assert.That(ex.Message, Does.StartWith("Unable to resolve")); + Assert.That(ex.Message, Does.StartWith("code: UnableToResolveUnknownService")); Assert.That(ex.Message, Does.Contain("NonDepFoo (IsResolutionCall)")); } } @@ -49,7 +49,7 @@ public void Resolve_ScopeRegisteredAndRequestedOutsideOfTheScope_ContainerExcept // Act & Assert var ex = Assert.Throws(() => _provider.Resolve()); - Assert.That(ex.Message, Does.StartWith("No current scope is available: probably you are registering to, or resolving from outside of the scope.")); + Assert.That(ex.Message, Does.StartWith("code: NoCurrentScope")); } [Test] @@ -565,7 +565,7 @@ public void ScopedResolve_SingletonDependsOnScoped_ContainerException() // Act && Assert var ex = Assert.Throws(() => scope.Resolver.Resolve()); - Assert.That(ex.Message, Does.Contain("IBar as parameter \"bar\" (IsSingletonOrDependencyOfSingleton) reuse Scoped {Lifespan=100} lifespan shorter than its parent's: Resolution root singleton")); + Assert.That(ex.Message, Does.Contain("code: DependencyHasShorterReuseLifespan")); } } @@ -798,7 +798,7 @@ public void Verify_MissingDependencyRegistration_ContainerException() // Act && Assert var ex = Assert.Throws(() => _provider.Verify()); - Assert.That(ex.Message, Does.StartWith("Unable to resolve")); + Assert.That(ex.Message, Does.StartWith("code: UnableToResolveUnknownService")); Assert.That(ex.Message, Does.Contain("IBar as parameter \"bar\"")); } @@ -850,7 +850,7 @@ public void Verify_SingletonDependsOnScoped_ContainerException() // Act && Assert var ex = Assert.Throws(() => _provider.Verify()); - Assert.That(ex.Message, Does.Contain("IBar as parameter \"bar\" (IsSingletonOrDependencyOfSingleton) reuse Scoped {Lifespan=100} lifespan shorter than its parent's: Resolution root singleton")); + Assert.That(ex.Message, Does.Contain("code: DependencyHasShorterReuseLifespan")); } // Note: this behavior check is not available diff --git a/src/Simplify.DI/Simplify.DI.csproj b/src/Simplify.DI/Simplify.DI.csproj index 26d22da1..40993551 100644 --- a/src/Simplify.DI/Simplify.DI.csproj +++ b/src/Simplify.DI/Simplify.DI.csproj @@ -22,7 +22,7 @@ bin\Any CPU\$(Configuration)\$(TargetFramework)\Simplify.DI.xml - +