From 090412cb538be60728f03aedf43ccf94a0e064af Mon Sep 17 00:00:00 2001 From: Alexandr Nikitin Date: Thu, 12 Jan 2017 16:00:45 +0200 Subject: [PATCH] Add a failing test for #529 --- ...eightAdapterRegistrationExtensionsTests.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/Autofac.Test/Features/LightweightAdapters/LightweightAdapterRegistrationExtensionsTests.cs b/test/Autofac.Test/Features/LightweightAdapters/LightweightAdapterRegistrationExtensionsTests.cs index a1d976eac..41f3c0c17 100644 --- a/test/Autofac.Test/Features/LightweightAdapters/LightweightAdapterRegistrationExtensionsTests.cs +++ b/test/Autofac.Test/Features/LightweightAdapters/LightweightAdapterRegistrationExtensionsTests.cs @@ -81,6 +81,30 @@ public void AdaptedMetadataIsPassed() } } + public class DecoratingServiceThatHasDefaultImplementation + { + readonly IContainer _container; + + public DecoratingServiceThatHasDefaultImplementation() + { + const string from = "from"; + var builder = new ContainerBuilder(); + + builder.RegisterType().As().Named(from); + builder.RegisterDecorator(s => new Decorator(s), from); + + _container = builder.Build(); + } + + [Fact(Skip = "Issue #529")] + public void InstanceWithDefaultImplementationIsDecorated() + { + var decorator = _container.Resolve(); + Assert.IsType(decorator); + Assert.IsType(((Decorator)decorator).Decorated); + } + } + public interface IService { }