示例#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;
        }
        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;
        }
 public bool CanEvalute(string name, FeatureDto feature)
 {
     return feature != null && feature.State == "Under Test";
 }
 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;
 }
 public bool CanEvalute(string name, FeatureDto feature)
 {
     return feature != null && feature.State == "In Development" && !FeatureBeeBuilder.Context.IsDebugMode;
 }
 public bool IsEnabled(string name, FeatureDto feature)
 {
     Logger.Log(TraceEventType.Verbose, "Feature {0} does not exist", name);
     return false;
 }
 public bool CanEvalute(string name, FeatureDto feature)
 {
     return feature == null;
 }
示例#8
0
 public bool CanEvalute(string featureName, FeatureDto feature)
 {
     return this.godModeFeatures.Any(x => x.Key.Equals(featureName, StringComparison.InvariantCultureIgnoreCase));
 }
示例#9
0
 public bool IsEnabled(string name, FeatureDto feature)
 {
     Logger.Log(TraceEventType.Verbose, "Feature {0} is 'Released'", feature.Name);
     return true;
 }
示例#10
0
 public bool CanEvalute(string name, FeatureDto feature)
 {
     return feature != null && feature.State == "Released";
 }