Exemple #1
0
        public void CreateSetsAFeatureId(string featureId)
        {
            IFeature feature = FeatureBuilder.Create(featureId)
                               .Build();

            Assert.Equal(featureId, feature.Id);
        }
Exemple #2
0
        public void WithTraitAddsFeatureTrait(string featureId, IFeatureTrait trait)
        {
            IFeature feature = FeatureBuilder.Create(featureId)
                               .WithTrait(trait)
                               .Build();

            Assert.Contains(trait, feature.Traits);
        }
Exemple #3
0
        public void DescriptionSetsDescription(string featureId, string description)
        {
            IFeature feature = FeatureBuilder.Create(featureId)
                               .Description(description)
                               .Build();

            Assert.Equal(description, feature.Description);
        }
Exemple #4
0
        public void xxx()
        {
            Feature.Context = new FeatureContext(new FeatureToggleProvider(
                                                     new AppSettingsToggle(),
                                                     new DefaultValueToggle()));

            IFeature MyFeature = FeatureBuilder.Create("MyFeature")
                                 .Description("This is my feature.")
                                 .WithDefaultValue(false)
                                 .Build();
        }
        public DependentFeatureUsage()
        {
            BaseFeature = FeatureBuilder.Create("BaseFeature")
                          .Description("This is the base feature")
                          .WithDefaultValue(false)
                          .Build();

            ChildFeature = FeatureBuilder.Create("BaseFeature.Child")
                           .Description("This is a child feature of the base feature, that should be disabled when the parent is.")
                           .WithDefaultValue(true)
                           .DependentOn(BaseFeature)
                           .Build();

            _featureContext = new FeatureContext(new FeatureTogglerSource(new DependentFeatureToggler(), new DefaultValueToggler()));
        }
Exemple #6
0
 public void WithTraitThrowsWhenPassedNullTrait(string featureId)
 {
     Assert.Throws <ArgumentNullException>(() => FeatureBuilder.Create(featureId).WithTrait(null));
 }
Exemple #7
0
 public void DescriptionThrowsWhenPassedNullDescription(string featureId)
 {
     Assert.Throws <ArgumentNullException>(() => FeatureBuilder.Create(featureId).Description(null));
 }
Exemple #8
0
 public void CreateThrowsWhenPassedNullFeatureId()
 {
     Assert.Throws <ArgumentNullException>(() => FeatureBuilder.Create(null));
 }