Exemplo n.º 1
0
        public bool IsEnabled(string featureName, FeatureDto feature)
        {
            var godMode = this.godModeFeatures.First(x => x.Key.Equals(featureName, StringComparison.InvariantCultureIgnoreCase));
            Logger.Log(TraceEventType.Verbose, "Feature {0} overwritten by GodMode. Value is {1}", featureName, godMode.Value);

            return godMode.Value;
        }
Exemplo n.º 2
0
        public bool IsEnabled(string name, FeatureDto feature)
        {
            var evaluators = FeatureBeeBuilder.Context.Evaluators;
            var isFulfilled = false;
            foreach (var condition in feature.Conditions)
            {
                var evaluator = evaluators.FirstOrDefault(x => string.Equals(x.Name, condition.Type));
                if (evaluator == null)
                {
                    return false;
                }

                isFulfilled = evaluator.IsFulfilled(condition.Values.ToArray());
                if (isFulfilled)
                {
                    continue;
                }

                Logger.Log(TraceEventType.Verbose, "Feature {0} does not fulfill condition {1} of type {2}", feature.Name, condition.Values, condition.Type);
                return false;
            }

            return isFulfilled;
        }
Exemplo n.º 3
0
 public bool CanEvalute(string name, FeatureDto feature)
 {
     return feature != null && feature.State == "Under Test";
 }
Exemplo n.º 4
0
 public bool IsEnabled(string name, FeatureDto feature)
 {
     Logger.Log(TraceEventType.Verbose, "Feature {0} is 'In Development' and debug mode is false", feature.Name);
     return false;
 }
Exemplo n.º 5
0
 public bool CanEvalute(string name, FeatureDto feature)
 {
     return feature != null && feature.State == "In Development" && !FeatureBeeBuilder.Context.IsDebugMode;
 }
Exemplo n.º 6
0
 public bool IsEnabled(string name, FeatureDto feature)
 {
     Logger.Log(TraceEventType.Verbose, "Feature {0} does not exist", name);
     return false;
 }
Exemplo n.º 7
0
 public bool CanEvalute(string name, FeatureDto feature)
 {
     return feature == null;
 }
Exemplo n.º 8
0
 public bool CanEvalute(string featureName, FeatureDto feature)
 {
     return this.godModeFeatures.Any(x => x.Key.Equals(featureName, StringComparison.InvariantCultureIgnoreCase));
 }
Exemplo n.º 9
0
 public bool IsEnabled(string name, FeatureDto feature)
 {
     Logger.Log(TraceEventType.Verbose, "Feature {0} is 'Released'", feature.Name);
     return true;
 }
Exemplo n.º 10
0
 public bool CanEvalute(string name, FeatureDto feature)
 {
     return feature != null && feature.State == "Released";
 }