/// <summary> /// Enqueues a job for the given application name and queue name. /// </summary> /// <param name="applicationName">The name of the application to enqueue the job for.</param> /// <param name="queueName">The name of the queue to enqueue the job on, or null for the default queue.</param> public void Enqueue(string applicationName, string queueName) { using (IRepository repository = new ConfigurationRepositoryFactory().Create()) { this.Enqueue(applicationName, queueName, repository); } }
public void RepositoryFactoryConfigurationCreateWithSpecified() { IRepositoryFactory factory = new ConfigurationRepositoryFactory("BlueCollar.Test.TestNoOpRepository, BlueCollar.Test", "TestNoOpRepository"); IRepository repository = factory.Create(); Assert.IsNotNull(repository); Assert.IsInstanceOfType(repository, typeof(TestNoOpRepository)); Assert.AreEqual(ConfigurationManager.ConnectionStrings["TestNoOpRepository"].ConnectionString, ((TestNoOpRepository)repository).ConnectionString); }
public void RepositoryFactoryConfigurationCreateWithDefaults() { RepositoryElement defaultConfig = new RepositoryElement(); IRepositoryFactory factory = new ConfigurationRepositoryFactory(defaultConfig.RepositoryType, defaultConfig.ConnectionStringName); IRepository repository = factory.Create(); Assert.IsNotNull(repository); Assert.IsInstanceOfType(repository, typeof(SQLiteRepository)); }
public void RepositoryFactoryConfigurationFailCreateWithMissingConnectionString() { IRepositoryFactory factory = new ConfigurationRepositoryFactory("BlueCollar.Test.TestNoOpRepository, BlueCollar.Test", "NotAConnectionStringName"); factory.Create(); }
public void RepositoryFactoryConfigurationFailCreateNotAnIRepository() { IRepositoryFactory factory = new ConfigurationRepositoryFactory("BlueCollar.Test.RepositoryFactoryTests, BlueCollar.Test", null); factory.Create(); }