public void EnsureProvider_unregisters_provider_when_null()
        {
            DependencyResolver.RegisterProvider(typeof(SqlProviderServices), "System.Data.SqlClient");

            DependencyResolver.EnsureProvider("System.Data.SqlClient", null);

            Assert.IsType <LegacyDbProviderServicesWrapper>(
                DependencyResolver.GetService <DbProviderServices>("System.Data.SqlClient"));
        }
        public void DependencyResolver_can_register_unregister_provider()
        {
            DependencyResolver.RegisterProvider(typeof(SqlProviderServices), "System.Data.SqlClient");
            try
            {
                Assert.Same(
                    SqlProviderServices.Instance,
                    DependencyResolver.GetService <DbProviderServices>("System.Data.SqlClient"));
            }
            finally
            {
                DependencyResolver.UnregisterProvider("System.Data.SqlClient");
            }

            Assert.IsType <LegacyDbProviderServicesWrapper>(
                DependencyResolver.GetService <DbProviderServices>("System.Data.SqlClient"));
        }