Skip to content

Commit

Permalink
Add a failing test for autofac#529
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrnikitin committed Jan 20, 2017
1 parent 9753b92 commit 090412c
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Implementer1>().As<IService>().Named<IService>(from);
builder.RegisterDecorator<IService>(s => new Decorator(s), from);

_container = builder.Build();
}

[Fact(Skip = "Issue #529")]
public void InstanceWithDefaultImplementationIsDecorated()
{
var decorator = _container.Resolve<IService>();
Assert.IsType<Decorator>(decorator);
Assert.IsType<Implementer1>(((Decorator)decorator).Decorated);
}
}

public interface IService
{
}
Expand Down

0 comments on commit 090412c

Please sign in to comment.