private void AddDbContexts(IServiceCollection services) { string curioClientConnectionString = Configuration.GetConnectionString("CurioClientPostgre"); string curioIdentityConnectionString = Configuration.GetConnectionString("CurioIdentityPostgre"); StartupSetup.AddDbContext <CurioClientDbContext>(services, curioClientConnectionString); StartupSetup.AddDbContext <CurioIdentityDbContext>(services, curioIdentityConnectionString); }
public void StartDoesStartThem() { var startups = StartupSetup.InAssembly <StartupSetupTests>().ToArray(); var saysStarteds = startups.Cast <ISaysStarted>().ToArray(); startups.Start(null); Assert.True(saysStarteds[0].Started); Assert.True(saysStarteds[1].Started); }
static void Main(string[] args) { string baseAddress = "http://localhost:9000/"; CustomEventLog.RegisterCustomEventLog(); var startupSetup = new StartupSetup(); var databaseEnsured = startupSetup.EnsureStorage(); if (databaseEnsured) { Console.WriteLine("Database Ensured"); } // Start OWIN host using (WebApp.Start <Startup>(url: baseAddress)) { // Create HttpCient and make a request to api/values HttpClient client = new HttpClient(); Console.ReadLine(); } }
public void Start_EventDriven_Success() { //Assemble var setup = new StartupSetup(); setup.AddFile("testfile.dll"); setup.AddType(typeof(TestEventDrivenInterface)); var startup = new Startup( setup.BatchDrivenInterfaceManager, setup.EventDrivenInterfaceManager, setup.FileSystem, setup.AssemblyInfo); var tokenSource = new CancellationTokenSource(); //Act startup.StartAsync(tokenSource.Token); //Assert Assert.Single(setup.EventDrivenInterfaceManager.Interfaces); }
public void FindsAllStartupsByType() { Assert.Equal(2, StartupSetup.InAssembly <StartupSetupTests>().Count()); }
public void FindsAllStartupsByPassingAssembly() { Assert.Equal(2, StartupSetup.InAssembly(Assembly.GetExecutingAssembly()).Count()); }