public void FabriqueByNameShouldWorksWell() { // GIVEN IoCContainer container = new IoCContainer(); // WHEN Test obj = new Test(); int hits = 0; Func <Test> fabriqueMethod = () => { hits++; return(obj); }; container.RegisterFabrique("test", fabriqueMethod); Action createFirst = () => container.Get("test"); Action createSecond = () => container.Get("test"); // THEN createFirst.ShouldNotThrow(); createSecond.ShouldNotThrow(); hits.Should().Be(2); }