public void CreateSetsAFeatureId(string featureId) { IFeature feature = FeatureBuilder.Create(featureId) .Build(); Assert.Equal(featureId, feature.Id); }
public void WithTraitAddsFeatureTrait(string featureId, IFeatureTrait trait) { IFeature feature = FeatureBuilder.Create(featureId) .WithTrait(trait) .Build(); Assert.Contains(trait, feature.Traits); }
public void DescriptionSetsDescription(string featureId, string description) { IFeature feature = FeatureBuilder.Create(featureId) .Description(description) .Build(); Assert.Equal(description, feature.Description); }
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())); }
public void WithTraitThrowsWhenPassedNullTrait(string featureId) { Assert.Throws <ArgumentNullException>(() => FeatureBuilder.Create(featureId).WithTrait(null)); }
public void DescriptionThrowsWhenPassedNullDescription(string featureId) { Assert.Throws <ArgumentNullException>(() => FeatureBuilder.Create(featureId).Description(null)); }
public void CreateThrowsWhenPassedNullFeatureId() { Assert.Throws <ArgumentNullException>(() => FeatureBuilder.Create(null)); }