Skip to content

Commit

Permalink
Merge pull request #826 from alexandrnikitin/#529-test
Browse files Browse the repository at this point in the history
Add a failing test for #529
  • Loading branch information
tillig authored Jan 20, 2017
2 parents 328e36c + 090412c commit 53b5637
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 53b5637

Please sign in to comment.