public void ConfigureDesignTimeServices_is_noop_when_not_found()
        {
            var startup = new StartupInvoker(
                typeof(StartupInvokerTest).Assembly.FullName,
                environment: "Unknown");

            startup.ConfigureDesignTimeServices(new ServiceCollection());
        }
Ejemplo n.º 2
0
        public void ConfigureDesignTimeServices_is_noop_when_not_found()
        {
            var startup = new StartupInvoker(
                typeof(StartupInvokerTest).Assembly.FullName,
                environment: "Unknown");

            startup.ConfigureDesignTimeServices(new ServiceCollection());
        }
        public void ConfigureDesignTimeServices_invokes_static_methods()
        {
            var services = new ServiceCollection();
            var startup = new StartupInvoker(
                typeof(StartupInvokerTest).Assembly.FullName,
                "Static");

            startup.ConfigureDesignTimeServices(services);

            var service = services.BuildServiceProvider().GetRequiredService<TestService>();
            Assert.Equal("Static", service.Value);
        }
        public void ConfigureDesignTimeServices_uses_Development_environment_when_unspecified()
        {
            var services = new ServiceCollection();
            var startup = new StartupInvoker(
                typeof(StartupInvokerTest).Assembly.FullName,
                environment: null);

            startup.ConfigureDesignTimeServices(services);

            var service = services.BuildServiceProvider().GetRequiredService<TestService>();
            Assert.Equal("Development", service.Value);
        }
Ejemplo n.º 5
0
        public void ConfigureDesignTimeServices_invokes_static_methods()
        {
            var services = new ServiceCollection();
            var startup  = new StartupInvoker(
                typeof(StartupInvokerTest).Assembly.FullName,
                "Static");

            startup.ConfigureDesignTimeServices(services);

            var service = services.BuildServiceProvider().GetRequiredService <TestService>();

            Assert.Equal("Static", service.Value);
        }
Ejemplo n.º 6
0
        public void ConfigureDesignTimeServices_uses_Development_environment_when_unspecified()
        {
            var services = new ServiceCollection();
            var startup  = new StartupInvoker(
                typeof(StartupInvokerTest).Assembly.FullName,
                environment: null);

            startup.ConfigureDesignTimeServices(services);

            var service = services.BuildServiceProvider().GetRequiredService <TestService>();

            Assert.Equal("Development", service.Value);
        }
Ejemplo n.º 7
0
        public void ConfigureDesignTimeServices_works_on_other_types()
        {
            var services = new ServiceCollection();
            var startup  = new StartupInvoker(
                typeof(StartupInvokerTest).Assembly.FullName,
                environment: null);

            startup.ConfigureDesignTimeServices(typeof(NotStartup), services);

            var service = services.BuildServiceProvider().GetRequiredService <TestService>();

            Assert.Equal("NotStartup", service.Value);
        }
        public void ConfigureDesignTimeServices_works_on_other_types()
        {
            var services = new ServiceCollection();
            var startup = new StartupInvoker(
                typeof(StartupInvokerTest).Assembly.FullName,
                environment: null);

            startup.ConfigureDesignTimeServices(typeof(NotStartup), services);

            var service = services.BuildServiceProvider().GetRequiredService<TestService>();
            Assert.Equal("NotStartup", service.Value);
        }
 private void ConfigureProviderServices(string provider, IServiceCollection services, bool throwOnError = false)
 => _startup.ConfigureDesignTimeServices(GetProviderDesignTimeServices(provider, throwOnError), services);