public void FullConfiguration_SetCustomPackageNameAndSection_ProviderIsConfigured()
        {
            // Arrange
            var config = new ServiceFabricConfiguration {
                ConfigPackageName = "TestConfig", ConfigSectionName = "Toggles"
            };

            // Act and Assert
            Should.NotThrow(() => ServiceFabricConfigProvider.Configure(config));
        }
        public void FeatureEnabled_ToggleNameIsWithoutPrefixAndConfigured_ToggleValueIsTrue()
        {
            // Arrange
            ServiceFabricConfigProvider.Configure(usePrefix: false);
            SetToggleInConfig(nameof(TestFeatureToggle), bool.TrueString);
            var toggle = new TestFeatureToggle();
            // Act
            var toggleValue = toggle.FeatureEnabled;

            // Assert
            toggleValue.ShouldBeTrue();
        }
Esempio n. 3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            ServiceFabricConfigProvider.Configure("Config", "Features", true);
        }
 public void FullConfiguration_ConfigurationIsNull_ThrowsArgumentNullException()
 {
     Should.Throw <ArgumentNullException>(() => ServiceFabricConfigProvider.Configure(null));
 }
 public void SimpleConfiguration_SetCustomPackageNameAndSection_ProviderIsConfigured()
 {
     Should.NotThrow(() => ServiceFabricConfigProvider.Configure("Testconfig", "Toggles"));
 }
 public void SimpleConfiguration_ConfigSectionNameIsNull_ThrowsArgumentException()
 {
     Should.Throw <ArgumentException>(() => ServiceFabricConfigProvider.Configure("Testconfig", null));
 }
 public void SimpleConfiguration_ConfigPackageNameIsNull_ThrowsArgumentException()
 {
     Should.Throw <ArgumentException>(() => ServiceFabricConfigProvider.Configure(null, "Toggles"));
 }
Esempio n. 8
0
 public void Setup()
 {
     ServiceFabricConfigProvider.Configure(usePrefix: false);
 }
Esempio n. 9
0
 public void BaseSetup()
 {
     ServiceFabricConfigProvider.Configure(new ServiceFabricConfiguration());
     ServiceFabricConfigProvider.SetCodePackageActivationContextFactory(TestConfig.CreateMockCodePackageActivationContext);
 }