コード例 #1
0
        public void IsActive_FeatureStatus_ShouldBeExpected(string featureName, bool expectedResult)
        {
            // arrange
            var services        = new CustomServiceCollection();
            var settingsJObject = ReadSettingsFile("full_data.json");

            using (var serviceProvider = services.BuildServiceProvider())
            {
                // act
                var featuresAgent = serviceProvider.GetService <IFeaturesAgent>();
                var result        = featuresAgent.IsActive(featureName, settingsJObject);

                // assert
                Assert.Equal(expectedResult, result);
            }
        }
コード例 #2
0
        public void IsActive_OrdersBrowsing_ShouldBeInactive()
        {
            // arrange
            var services = new CustomServiceCollection();

            // in this sample were removed services from 'replaces' sections
            var settingsJObject = ReadSettingsFile("full_data_with_disabled_feature.json");

            using (var serviceProvider = services.BuildServiceProvider())
            {
                // act
                var featuresAgent = serviceProvider.GetService <IFeaturesAgent>();
                var result        = featuresAgent.IsActive("OrdersBrowsing", settingsJObject);

                // assert
                Assert.False(result);
            }
        }
コード例 #3
0
        public void IsActive_FeatureWithConflicts_ShouldBeInactive(string featureName, bool expectedResult)
        {
            // arrange
            var services = new CustomServiceCollection();

            // in this sample were removed services from 'replaces' sections
            var settingsJObject = ReadSettingsFile("full_data_with_conflicts.json");

            using (var serviceProvider = services.BuildServiceProvider())
            {
                // act
                var featuresAgent = serviceProvider.GetService <IFeaturesAgent>();
                var result        = featuresAgent.IsActive(featureName, settingsJObject);

                // assert
                Assert.Equal(expectedResult, result);
            }
        }