Esempio n. 1
0
 public EventPublisher(IEventingRepoFactory repoFactory, DateTimeProvider dtProvider, TimeSpan cacheDuration, InvokeOptions invokeOptions)
 {
     _repoFactory   = repoFactory;
     _dtProvider    = dtProvider;
     _cacheDuration = cacheDuration;
     _invokeOptions = invokeOptions;
 }
        public EventingRepoFactoryFixture()
            : base()
        {
            var useMySql = (this.Configuration["UseMySql"] == "true"); // Can be set from environment variable

            Console.WriteLine("Running tests on " + (useMySql ? "MySQL" : "MS SQL Server"));
            var connectionString = this.Configuration.GetConnectionString(useMySql ? "Resonance.MySql" : "Resonance.MsSql");

            if (useMySql)
            {
                RepoFactory = new MySqlEventingRepoFactory(connectionString);
                using (var conn = new MySqlConnection(connectionString))
                {
                    conn.Open();
                    CleanDb(conn);
                }
            }
            else
            {
                RepoFactory = new MsSqlEventingRepoFactory(connectionString);
                using (var conn = new SqlConnection(connectionString))
                {
                    conn.Open();
                    CleanDb(conn);
                }
            }
        }
Esempio n. 3
0
 public EventPublisher(IEventingRepoFactory repoFactory, DateTimeProvider dtProvider, TimeSpan cacheDuration)
     : this(repoFactory, dtProvider, cacheDuration, InvokeOptions.Default)
 {
 }
Esempio n. 4
0
 public EventPublisher(IEventingRepoFactory repoFactory, DateTimeProvider dtProvider)
     : this(repoFactory, dtProvider, TimeSpan.FromSeconds(30))
 {
 }
Esempio n. 5
0
 public EventPublisher(IEventingRepoFactory repoFactory)
     : this(repoFactory, DateTimeProvider.Repository)
 {
 }
Esempio n. 6
0
 public EventConsumer(IEventingRepoFactory repoFactory, TimeSpan cacheDuration, InvokeOptions invokeOptions)
 {
     _repoFactory   = repoFactory;
     _cacheDuration = cacheDuration;
     _invokeOptions = invokeOptions;
 }
Esempio n. 7
0
 public EventConsumer(IEventingRepoFactory repoFactory, TimeSpan cacheDuration)
     : this(repoFactory, cacheDuration, InvokeOptions.Default)
 {
 }
Esempio n. 8
0
 public EventConsumer(IEventingRepoFactory repoFactory)
     : this(repoFactory, TimeSpan.FromSeconds(30))
 {
 }