public void Successfully() { var result = new DatabaseCommanderSettings(_namespaceSettings, _connectionStringSettings); Equal(_connectionStringSettings, result.Connections); Equal(_namespaceSettings, result.Namespaces); }
public GetCommand() { var namespaces = new List <DatabaseCommandNamespaceSetting> { new DatabaseCommandNamespaceSetting( "Syrx", new List <DatabaseCommandTypeSetting> { new DatabaseCommandTypeSetting( "Syrx.RootNamespaceTest", new Dictionary <string, DatabaseCommandSetting> { ["Retrieve"] = new DatabaseCommandSetting("test.alias.rootnamespace", "root namespace") }) }), new DatabaseCommandNamespaceSetting( "Syrx.Readers.Databases", new List <DatabaseCommandTypeSetting> { new DatabaseCommandTypeSetting( "Syrx.Readers.Databases.Unit.Tests.DatabaseCommandReaderTests.Dummy", new Dictionary <string, DatabaseCommandSetting> { ["Retrieve"] = new DatabaseCommandSetting("test.alias", "dummy text") }), new DatabaseCommandTypeSetting( "Syrx.Readers.Databases.Unit.Tests.DatabaseCommandReaderTests.NoCommandSettingTest", new Dictionary <string, DatabaseCommandSetting> { ["Retrieve"] = new DatabaseCommandSetting("test.alias", "dummy text") }), new DatabaseCommandTypeSetting( "Syrx.Readers.Databases.Unit.Tests.DatabaseCommandReaderTests.ParentNamespaceTest", new Dictionary <string, DatabaseCommandSetting> { ["Retrieve"] = new DatabaseCommandSetting("test.alias.parentnamespace", "parent namespace") }) }), new DatabaseCommandNamespaceSetting( "Syrx.Testing.Readers", new List <DatabaseCommandTypeSetting> { new DatabaseCommandTypeSetting( "Syrx.Testing.Readers.FullNamespaceTest", new Dictionary <string, DatabaseCommandSetting> { ["Retrieve"] = new DatabaseCommandSetting("test.alias.fullnamespacetest", "fullnamespacetest") }) }) }; var settings = new DatabaseCommanderSettings(namespaces); _reader = new DatabaseCommandReader(settings); }
public void SupportsMutableConnectionSettings() { var newConnections = new List <ConnectionStringSetting> { new ConnectionStringSetting("connections.a", "connection.string.a") }; var result = new DatabaseCommanderSettings(_namespaceSettings, _connectionStringSettings); Equal(_connectionStringSettings, result.Connections); // mutate result.Connections = newConnections; Equal(newConnections, result.Connections); }
public Constructor() { _settings = new DatabaseCommanderSettings( new List <DatabaseCommandNamespaceSetting> { new DatabaseCommandNamespaceSetting( typeof(DatabaseCommandNamespaceSetting).Namespace, new List <DatabaseCommandTypeSetting> { new DatabaseCommandTypeSetting( typeof(DatabaseCommandTypeSetting).FullName, new Dictionary <string, DatabaseCommandSetting> { ["Retrieve"] = new DatabaseCommandSetting("test.alias", "select 'Readers.Test.Settings'") }) }) } , new List <ConnectionStringSetting> { new ConnectionStringSetting("test.alias", "connectionString") }); }
public void NullConnectionStringSettingsSupported() { var result = new DatabaseCommanderSettings(_namespaceSettings); Equal(_namespaceSettings, result.Namespaces); }