diff --git a/src/Umbraco.Tests/Composing/ContainerConformingTests.cs b/src/Umbraco.Tests/Composing/ContainerConformingTests.cs index f5c1ff9bc7..06ab246d84 100644 --- a/src/Umbraco.Tests/Composing/ContainerConformingTests.cs +++ b/src/Umbraco.Tests/Composing/ContainerConformingTests.cs @@ -330,6 +330,17 @@ namespace Umbraco.Tests.Composing var s1 = factory.GetInstance(); var s2 = factory.GetInstance(); Assert.AreSame(s1, s2); + + register.Register(factory => + { + var param1 = new Thing1(); + var param2 = new Thing1(); + + return factory.CreateInstance(param1, param2); + }); + + var instance = factory.GetInstance(); + Assert.AreNotEqual(instance.Thing, instance.AnotherThing); } public interface IThing { } @@ -352,5 +363,17 @@ namespace Umbraco.Tests.Composing public IEnumerable Things { get; } } + + public class Thing4 : ThingBase + { + public readonly Thing1 Thing; + public readonly Thing1 AnotherThing; + + public Thing4(Thing1 thing, Thing1 anotherThing) + { + Thing = thing; + AnotherThing = anotherThing; + } + } } }