public void CreateFactory(InitMode mode)
        {
            var actualServices  = mode.HasFlag(InitMode.Services) ? Services.Object : null;
            var actualRegistrar = mode.HasFlag(InitMode.Registrar) ? Registrar.Object : null;

            Factory = new KeyedServiceFactory(actualRegistrar, actualServices);
        }
        public TestUniverse(InitMode mode = InitMode.All)
        {
            Services  = new Mock <IServiceProvider>(MockBehavior.Strict);
            Registrar = new Mock <IKeyedServiceRegister>(MockBehavior.Strict);

            if (mode.HasFlag(InitMode.CreateFactory))
            {
                CreateFactory(mode);
            }
        }