Ejemplo n.º 1
0
        public void should_create_an_instance_of_all_registered_provider_factories()
        {
            var config = new Configuration.Configuration();

            config.Providers.Add("my-provider", typeof(ProviderFactory));

            Assert.That(() => config.CreateProviders(o => {}), Throws.Nothing);
            var objects = config.CreateProviders();

            Assert.That(objects.Length, Is.EqualTo(1));
        }
Ejemplo n.º 2
0
        public void should_created_an_instance_only_if_provider_implements_IProviderFactory_interface()
        {
            var config = new Configuration.Configuration();

            config.Providers.Add("my-provider", typeof(ProviderFactory));
            config.Providers.Add("my-provider-2", typeof(string));

            Assert.That(() => config.CreateProviders(o => { }), Throws.Nothing);
            var objects = config.CreateProviders();

            Assert.That(objects.Length, Is.EqualTo(1));
        }