-
-
Notifications
You must be signed in to change notification settings - Fork 838
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #780: Disposal tracking of provided instances is now consistent…
… in root and nested lifetime scopes.
- Loading branch information
Showing
3 changed files
with
185 additions
and
22 deletions.
There are no files selected for viewing
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
20 changes: 20 additions & 0 deletions
20
test/Autofac.Test/Core/Registration/ComponentRegistrationLifetimeDecoratorTests.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Autofac.Core.Lifetime; | ||
using Autofac.Core.Registration; | ||
using Xunit; | ||
|
||
namespace Autofac.Test.Core.Registration | ||
{ | ||
public class ComponentRegistrationLifetimeDecoratorTests | ||
{ | ||
[Fact] | ||
public void DecoratorCallsDisposeOnInnerInstance() | ||
{ | ||
var inner = Mocks.GetComponentRegistration(); | ||
var decorator = new ComponentRegistrationLifetimeDecorator(inner, new CurrentScopeLifetime()); | ||
|
||
decorator.Dispose(); | ||
|
||
Assert.True(inner.IsDisposed); | ||
} | ||
} | ||
} |
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