public void FeatureWithMultipleDefaultValueTraitsThrows(FeatureFixture feature,
            IEnumerable<DefaultValueTrait> defaultValueTraits, DefaultValueToggle sut)
        {
            feature.Traits.AddRange(defaultValueTraits);

            Assert.Throws<InvalidFeatureException>(() => sut.IsEnabled(feature));
        }
        public void ReturnsNullWhenNoValueExists(FeatureFixture feature, Fixture fixture, AppSettingsToggle sut)
        {
            feature.Id = fixture.Create<string>();

            bool? result = sut.IsEnabled(feature);

            Assert.Equal(null, result);
        }
        public void FeatureWithDefaultValueTraitShouldReturnDefaultValue(FeatureFixture feature,
            DefaultValueTrait defaultValueTrait, DefaultValueToggle sut)
        {
            feature.Traits.Add(defaultValueTrait);

            bool? result = sut.IsEnabled(feature);

            Assert.Equal(defaultValueTrait.DefaultValue, result);
        }
        public void ReturnsAppSettingValueWhenSet(string value, bool? expected, FeatureFixture feature, Fixture fixture, AppSettingsToggle sut)
        {
            // Apparently AutoFixture will reuse the feature
            feature.Id = fixture.Create<string>();

            using (AppSetting.Use($"{AppSettingsToggle.SettingsPrefix}{feature.Id}", value))
            {
                bool? result = sut.IsEnabled(feature);

                Assert.Equal(expected, result);
            }
        }
        public void FeatureWithoutDefaultValueTraitShouldReturnNull(FeatureFixture feature, DefaultValueToggle sut)
        {
            bool? result = sut.IsEnabled(feature);

            Assert.Null(result);
        }