From c3a9040e0cd1940d1b470d8213e937c069a66388 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Sat, 9 Mar 2019 11:11:03 -0800 Subject: [PATCH] Revert "Updated decorator tests to handle issue #963 caveats. Skipped for now." This reverts commit 8ea04f0a15fa3de72011ef080b841271e561f688. --- .../Features/Decorators/DecoratorTests.cs | 11 ++++------- .../Features/Decorators/OpenGenericDecoratorTests.cs | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/test/Autofac.Test/Features/Decorators/DecoratorTests.cs b/test/Autofac.Test/Features/Decorators/DecoratorTests.cs index c41bc2e8f..81fd4f4b2 100644 --- a/test/Autofac.Test/Features/Decorators/DecoratorTests.cs +++ b/test/Autofac.Test/Features/Decorators/DecoratorTests.cs @@ -13,12 +13,12 @@ public interface IService { } - public interface IDecoratedService + public interface IDecoratedService : IService { IDecoratedService Decorated { get; } } - public class ImplementorA : IDecoratedService, IService + public class ImplementorA : IDecoratedService { public IDecoratedService Decorated => this; } @@ -189,12 +189,9 @@ public void DecoratedRegistrationCanIncludeImplementationType() Assert.IsType(container.Resolve()); } - [Fact(Skip = "Issue #963")] + [Fact] public void DecoratedRegistrationCanIncludeOtherServices() { - // Issue #963 - Make sure IDecoratedService does _not_ derive from - // IService. The idea is that a component may provide multiple - // services but only one of them may be decorated. var builder = new ContainerBuilder(); builder.RegisterType().As().As(); builder.RegisterDecorator(); @@ -207,7 +204,7 @@ public void DecoratedRegistrationCanIncludeOtherServices() Assert.NotNull(decoratedServiceRegistration); Assert.Same(serviceRegistration, decoratedServiceRegistration); - Assert.IsType(container.Resolve()); + Assert.IsType(container.Resolve()); Assert.IsType(container.Resolve()); } diff --git a/test/Autofac.Test/Features/Decorators/OpenGenericDecoratorTests.cs b/test/Autofac.Test/Features/Decorators/OpenGenericDecoratorTests.cs index 1058c7761..bca06a1d1 100644 --- a/test/Autofac.Test/Features/Decorators/OpenGenericDecoratorTests.cs +++ b/test/Autofac.Test/Features/Decorators/OpenGenericDecoratorTests.cs @@ -14,12 +14,12 @@ public interface IService { } - public interface IDecoratedService + public interface IDecoratedService : IService { IDecoratedService Decorated { get; } } - public class ImplementorA : IDecoratedService, IService + public class ImplementorA : IDecoratedService { public IDecoratedService Decorated => this; } @@ -186,12 +186,9 @@ public void DecoratedRegistrationCanIncludeImplementationType() Assert.IsType>(container.Resolve>()); } - [Fact(Skip = "Issue #963")] + [Fact] public void DecoratedRegistrationCanIncludeOtherServices() { - // Issue #963 - Make sure IDecoratedService does _not_ derive from - // IService. The idea is that a component may provide multiple - // services but only one of them may be decorated. var builder = new ContainerBuilder(); builder.RegisterGeneric(typeof(ImplementorA<>)).As(typeof(IDecoratedService<>)).As(typeof(IService<>)); builder.RegisterGenericDecorator(typeof(DecoratorA<>), typeof(IDecoratedService<>)); @@ -204,7 +201,7 @@ public void DecoratedRegistrationCanIncludeOtherServices() Assert.NotNull(decoratedServiceRegistration); Assert.Same(serviceRegistration, decoratedServiceRegistration); - Assert.IsType>(container.Resolve>()); + Assert.IsType>(container.Resolve>()); Assert.IsType>(container.Resolve>()); }