public void InitializeSettingsProvidersShouldWorkForEmptyRunSettings() { var runSettings = new RunSettings(); runSettings.InitializeSettingsProviders(this.GetEmptyRunSettings()); Assert.IsNull(runSettings.GetSettings("RunSettings")); }
public void InitializeSettingsProvidersShouldLoadSettingsIntoMultipleSettingsProviders() { TestPluginCacheTests.SetupMockExtensions(); var runSettings = new RunSettings(); runSettings.InitializeSettingsProviders(this.GetRunSettingsWithRunConfigurationAndMSTestNode()); var rcSettingsProvider = runSettings.GetSettings("RunConfiguration"); var mstestSettingsProvider = runSettings.GetSettings("MSTest"); Assert.IsNotNull(rcSettingsProvider); Assert.IsTrue(rcSettingsProvider is RunConfigurationSettingsProvider); Assert.AreEqual( "<RunConfiguration><Architecture>x86</Architecture></RunConfiguration>", (rcSettingsProvider as RunConfigurationSettingsProvider).SettingsTree); Assert.IsNotNull(mstestSettingsProvider); Assert.IsTrue(mstestSettingsProvider is MSTestSettingsProvider); Assert.AreEqual( "<MSTest><NoAppDomain>true</NoAppDomain></MSTest>", (mstestSettingsProvider as MSTestSettingsProvider).SettingsTree); }
public void InitializeSettingsProvidersShouldThrowIfNodeInRunSettingsDoesNotHaveAProvider() { TestPluginCacheTests.SetupMockExtensions(); var runSettings = new RunSettings(); runSettings.InitializeSettingsProviders(this.GetRunSettingsWithUndefinedSettingsNodes()); Action action = () => runSettings.GetSettings("OrphanNode"); Assert.ThrowsException <SettingsException>( action, "Settings Provider named '{0}' was not found. The settings can not be loaded.", "OrphanNode"); }
public void InitializeSettingsProvidersShouldThrowIfSettingsProviderLoadThrows() { TestPluginCacheTests.SetupMockExtensions(); var runSettings = new RunSettings(); runSettings.InitializeSettingsProviders(this.GetRunSettingsWithBadSettingsNodes()); Action action = () => runSettings.GetSettings("BadSettings"); Assert.ThrowsException <SettingsException>( action, "An error occurred while initializing the settings provider named '{0}'", "BadSettings"); }
public void InitializeSettingsProvidersShouldLoadSettingsIntoASettingsProvider() { TestPluginCacheTests.SetupMockExtensions(); var runSettings = new RunSettings(); runSettings.InitializeSettingsProviders(this.GetRunSettingsWithRunConfigurationNode()); var settingsProvider = runSettings.GetSettings("RunConfiguration"); Assert.IsNotNull(settingsProvider); Assert.IsTrue(settingsProvider is RunConfigurationSettingsProvider); // Also validate that the settings provider gets the right subtree. Assert.AreEqual( "<RunConfiguration><Architecture>x86</Architecture></RunConfiguration>", (settingsProvider as RunConfigurationSettingsProvider).SettingsTree); }
public void GetSettingsShouldThrowIfSettingsNameIsEmpty() { var runSettings = new RunSettings(); Assert.ThrowsException <ArgumentException>(() => runSettings.GetSettings(" ")); }