Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 public void FindsAllStartupsByType()
 {
     Assert.Equal(2,
                  StartupSetup.InAssembly <StartupSetupTests>().Count());
 }
Esempio n. 6
0
 public void FindsAllStartupsByPassingAssembly()
 {
     Assert.Equal(2,
                  StartupSetup.InAssembly(Assembly.GetExecutingAssembly()).Count());
 }