public void GetSettingsProviderShouldThrowIfSettingsNameIsNullOrEmpty() { var extensions = this.GetMockExtensions("TestableSettings"); var unfilteredExtensions = new List <LazyExtension <ISettingsProvider, Dictionary <string, object> > > { new LazyExtension <ISettingsProvider, Dictionary <string, object> > ( new Mock <ISettingsProvider>().Object, new Dictionary <string, object>()) }; var spm = new TestableSettingsProviderManager(extensions, unfilteredExtensions, new Mock <IMessageLogger>().Object); Assert.ThrowsException <ArgumentException>(() => spm.GetSettingsProvider(null)); Assert.ThrowsException <ArgumentException>(() => spm.GetSettingsProvider(string.Empty)); }
public void GetSettingsProviderShouldReturnNullIfSettingsProviderWithSpecifiedNameIsNotFound() { var extensions = this.GetMockExtensions("TestableSettings"); var unfilteredExtensions = new List <LazyExtension <ISettingsProvider, Dictionary <string, object> > > { new LazyExtension <ISettingsProvider, Dictionary <string, object> > ( new Mock <ISettingsProvider>().Object, new Dictionary <string, object>()) }; var spm = new TestableSettingsProviderManager(extensions, unfilteredExtensions, new Mock <IMessageLogger>().Object); var sp = spm.GetSettingsProvider("RandomSettingsWhichDoesNotExist"); Assert.IsNull(sp); }
public void GetSettingsProviderShouldReturnSettingsProviderInstance() { var extensions = this.GetMockExtensions("TestableSettings"); var unfilteredExtensions = new List <LazyExtension <ISettingsProvider, Dictionary <string, object> > > { new LazyExtension <ISettingsProvider, Dictionary <string, object> > ( new Mock <ISettingsProvider>().Object, new Dictionary <string, object>()) }; var spm = new TestableSettingsProviderManager(extensions, unfilteredExtensions, new Mock <IMessageLogger>().Object); var sp = spm.GetSettingsProvider("TestableSettings"); Assert.IsNotNull(sp); Assert.IsNotNull(sp.Value); }