Ejemplo n.º 1
0
        public void CreateSetsAFeatureId(string featureId)
        {
            IFeature feature = FeatureBuilder.Create(featureId)
                               .Build();

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

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

            Assert.Equal(description, feature.Description);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 5
0
        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()));
        }
Ejemplo n.º 6
0
 public void WithTraitThrowsWhenPassedNullTrait(string featureId)
 {
     Assert.Throws <ArgumentNullException>(() => FeatureBuilder.Create(featureId).WithTrait(null));
 }
Ejemplo n.º 7
0
 public void DescriptionThrowsWhenPassedNullDescription(string featureId)
 {
     Assert.Throws <ArgumentNullException>(() => FeatureBuilder.Create(featureId).Description(null));
 }
Ejemplo n.º 8
0
 public void CreateThrowsWhenPassedNullFeatureId()
 {
     Assert.Throws <ArgumentNullException>(() => FeatureBuilder.Create(null));
 }