public void TestCreateScope <TService, TImplementation>(IDiContainer container)
            where TService : class
        {
            using (var scope = container.CreateScope())
            {
                container = scope.Container;

                var service = container.GetInstance <TService>();

                Xunit.Assert.IsType <TImplementation>(service);

                var service2 = container.GetInstance <TService>();

                Xunit.Assert.IsType <TImplementation>(service2);

                Xunit.Assert.Equal(service, service2);

                using (var innerScope = container.CreateScope())
                {
                    var scopedService = innerScope.Container.GetInstance <TService>();

                    Xunit.Assert.IsType <TImplementation>(scopedService);

                    var scopedService2 = innerScope.Container.GetInstance <TService>();

                    Xunit.Assert.IsType <TImplementation>(scopedService2);

                    Xunit.Assert.Equal(scopedService, scopedService2);

                    Xunit.Assert.NotEqual(service, scopedService);
                }
            }
        }
        public void TestScopeDisposeDouble(IDiContainer container)
        {
            var scope = container.CreateScope();

            scope.Dispose();
            scope.Dispose();
        }