Esempio n. 1
0
            public void Returns_GetCircuitBreakerForcedOpen_AppSetting_As_Boolean_For_GroupA_And_DependencyX()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("GroupA", "DependencyX");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                bool value = hystrixConfigurationService.GetCircuitBreakerForcedOpen();

                Assert.Equal(true, value);
            }
Esempio n. 2
0
            public void Returns_False_If_AppSetting_Does_Not_Exist()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("NonExistingGroup", "NonExistingCommand");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                bool value = hystrixConfigurationService.GetCircuitBreakerForcedOpen();

                Assert.Equal(false, value);
            }
Esempio n. 3
0
            public void Returns_HystrixCommandEnabled_AppSetting_As_Boolean_For_GroupA_And_DependencyX()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("GroupA", "DependencyX");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                bool value = hystrixConfigurationService.GetHystrixCommandEnabled();

                Assert.False(value);
            }
Esempio n. 4
0
            public void Returns_True_If_AppSetting_Does_Not_Exist()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("NonExistingGroup", "NonExistingCommand");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                bool value = hystrixConfigurationService.GetHystrixCommandEnabled();

                Assert.True(value);
            }
Esempio n. 5
0
            public void Returns_1000_If_AppSetting_Does_Not_Exist()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("NonExistingGroup", "NonExistingCommand");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                int value = hystrixConfigurationService.GetCommandTimeoutInMilliseconds();

                Assert.Equal(1000, value);
            }
Esempio n. 6
0
            public void Returns_100_If_AppSetting_Does_Not_Exist()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("NonExistingGroup", "NonExistingCommand");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                int value = hystrixConfigurationService.GetMetricsRollingPercentileBucketSize();

                Assert.Equal(100, value);
            }
Esempio n. 7
0
            public void Returns_MetricsRollingPercentileBucketSize_AppSetting_As_Integer_For_GroupA_And_DependencyX()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("GroupA", "DependencyX");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                int value = hystrixConfigurationService.GetMetricsRollingPercentileBucketSize();

                Assert.Equal(3000, value);
            }
Esempio n. 8
0
            public void Returns_CommandTimeoutInMilliseconds_AppSetting_As_Integer_For_GroupA_And_DependencyX()
            {
                var hystrixCommandIdentifier = new HystrixCommandIdentifier("GroupA", "DependencyX");
                var sut = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                int result = sut.GetCommandTimeoutInMilliseconds();

                Assert.Equal(1500, result);
            }
Esempio n. 9
0
            public void Returns_MetricsRollingStatisticalWindowInMilliseconds_AppSetting_As_Integer_For_GroupA_And_DependencyX()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("GroupA", "DependencyX");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                int value = hystrixConfigurationService.GetMetricsRollingStatisticalWindowInMilliseconds();

                Assert.Equal(3000, value);
            }
Esempio n. 10
0
            public void Returns_20_If_AppSetting_Does_Not_Exist()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("NonExistingGroup", "NonExistingCommand");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                int value = hystrixConfigurationService.GetCircuitBreakerRequestVolumeThreshold();

                Assert.Equal(20, value);
            }
Esempio n. 11
0
            public void Returns_CircuitBreakerRequestVolumeThreshold_AppSetting_As_Integer_For_GroupA_And_DependencyX()
            {
                var hystrixCommandIdentifier    = new HystrixCommandIdentifier("GroupA", "DependencyX");
                var hystrixConfigurationService = new HystrixLocalConfigurationService(hystrixCommandIdentifier, options);

                // Act
                int value = hystrixConfigurationService.GetCircuitBreakerRequestVolumeThreshold();

                Assert.Equal(50000, value);
            }