public Reflector(Dictionary <char, char> connections, ReflectorType type, IEventAggregator eventAggregator, IUtilityFactory utilityFactory) { _connections = connections; _utilityFactory = utilityFactory; Type = type; ReflectorAggregator = eventAggregator; }
public void Members_DifferentArguments_HaveExpectedProps() { // Arrange IUtilityFactory utilityFactory = SQLiteUtilityFactory.Instance; // get SQLite stuff loaded. using (new SQLiteConnection()) { } // Act var dbProviderName = utilityFactory.DbProviderName; IDbConnection connection = utilityFactory.CreateConnection(); var tuple = DbUtils.CreateSQLiteConnectionString(); var filePath = tuple.Item1; var connectionString = tuple.Item2; connection.ConnectionString = connectionString; connection.Open(); IDialect dialect = utilityFactory.GetDialect(); IScriptBuilder scriptBuilder = utilityFactory.CreateScriptBuilder(); IDbInspector dbInspector = utilityFactory.CreateDbInspector(connection); ITableInspector tableInspector = utilityFactory.CreateTableInspector(connection, "language"); ICruder cruder = utilityFactory.CreateCruder(connection); IDbSerializer dbSerializer = utilityFactory.CreateDbSerializer(connection); // Assert Assert.That(dbProviderName, Is.EqualTo("SQLite")); Assert.That(connection, Is.TypeOf <SQLiteConnection>()); Assert.That(dialect, Is.SameAs(SQLiteDialect.Instance)); Assert.That(scriptBuilder, Is.TypeOf <SQLiteScriptBuilder>()); Assert.That(scriptBuilder.CurrentOpeningIdentifierDelimiter, Is.EqualTo('[')); Assert.That(dbInspector, Is.TypeOf <SQLiteInspector>()); Assert.That(tableInspector, Is.TypeOf <SQLiteTableInspector>()); Assert.That(cruder, Is.TypeOf <SQLiteCruder>()); Assert.That(dbSerializer, Is.TypeOf <SQLiteSerializer>()); // Finalize connection.Dispose(); try { File.Delete(filePath); } catch { // dismiss } }
public Rotor(RotorSlot slot, int position, char[] connections, RotorType type, IEventAggregator eventAggregator, IUtilityFactory utilityFactory) { _utilityFactory = utilityFactory; Connections = connections; Slot = slot; PositionShift = position; Type = type; RotorAggregator = eventAggregator; }
public void Members_DifferentArguments_HaveExpectedProps() { // Arrange IUtilityFactory utilityFactory = SqlServerUtilityFactory.Instance; // Act var dbProviderName = utilityFactory.DbProviderName; IDbConnection connection = utilityFactory.CreateConnection(); connection.ConnectionString = TestHelper.ConnectionString; connection.Open(); IDialect dialect = utilityFactory.GetDialect(); IScriptBuilder scriptBuilder = utilityFactory.CreateScriptBuilder(); IDbInspector dbInspector = utilityFactory.CreateDbInspector(connection); ITableInspector tableInspector = utilityFactory.CreateTableInspector(connection, "language"); ICruder cruder = utilityFactory.CreateCruder(connection); IDbSerializer dbSerializer = utilityFactory.CreateDbSerializer(connection); // Assert Assert.That(dbProviderName, Is.EqualTo("SqlServer")); Assert.That(connection, Is.TypeOf <SqlConnection>()); Assert.That(dialect, Is.SameAs(SqlServerDialect.Instance)); Assert.That(scriptBuilder, Is.TypeOf <SqlServerScriptBuilder>()); Assert.That(scriptBuilder.CurrentOpeningIdentifierDelimiter, Is.EqualTo('[')); Assert.That(dbInspector, Is.TypeOf <SqlServerInspector>()); Assert.That(tableInspector, Is.TypeOf <SqlServerTableInspector>()); Assert.That(cruder, Is.TypeOf <SqlServerCruder>()); Assert.That(dbSerializer, Is.TypeOf <SqlServerSerializer>()); }
public ComponentFactory(IUtilityFactory utilityFactory) { InitializeDictionaries(); UtilityFactory = utilityFactory; }
public Plugboard(Dictionary <char, char> connections, IUtilityFactory utilityFactory) { _utilityFactory = utilityFactory; Connections = connections; }
public Enigma(IEnigmaSettings enigmaSettings, IUtilityFactory utilityFactory) { _enigmaSettings = enigmaSettings; _utilityFactory = utilityFactory; }