public void GetProvider_returns_provider_added_by_AddProvider() { var configuration = new DbConfiguration(); var provider = new Mock<DbProviderServices>().Object; configuration.AddProvider("Karl", provider); Assert.Same(provider, configuration.GetProvider("Karl")); }
public void AddProvider_throws_if_the_configuation_is_locked() { var configuration = new DbConfiguration(); configuration.Lock(); Assert.Equal( Strings.ConfigurationLocked("AddProvider"), Assert.Throws<InvalidOperationException>( () => configuration.AddProvider("Karl", new Mock<DbProviderServices>().Object)).Message); }