public ChangeableComponents(IFuzzStopCondition stopCondition, IDataGenerator dataGenerator, ITrigger[] triggers, bool isPreCondition) { StopCondition = stopCondition; DataGenerator = dataGenerator; Triggers = triggers; IsPreCondition = isPreCondition; }
public object InitChanges(XmlElement fuzzLocationRoot) { _isPreCondition = fuzzLocationRoot.Name == "PreCondition"; if (SupportsStopCondition) ReadStopCondition (fuzzLocationRoot); else _stopCondition = null; if (SupportsDataGen) ReadDataGen (fuzzLocationRoot); else _dataGenerator = null; if (SupportsTrigger) ReadTriggers (fuzzLocationRoot, _connector); else _triggers = null; ChangeableComponents changeableComponent = new ChangeableComponents ( _stopCondition, _dataGenerator, _triggers, _isPreCondition); _changeableComponents.Add (changeableComponent); InternInitChanges (changeableComponent, fuzzLocationRoot); return changeableComponent; }
private void ReadStopCondition(XmlElement root) { string stopCondition = XmlHelper.ReadString (root, "StopCondition"); if (stopCondition == null || stopCondition == string.Empty || stopCondition.Equals ("none")) _stopCondition = null; else { string[] stopConditionParts = stopCondition.Split (new char[] { '|' }, 2); if (stopConditionParts[0].Equals ("count", StringComparison.InvariantCultureIgnoreCase) && stopConditionParts.Length == 2) _stopCondition = new CountFuzzStopCondition (int.Parse (stopConditionParts[1])); else throw new NotImplementedException (string.Format ("Invalid stop condition identifier '{0}'", stopCondition)); } }
public void ApplyChangeableId(object changeableId) { if (changeableId != null && changeableId is ChangeableComponents && _changeableComponents.Contains ((ChangeableComponents)changeableId)) { _stopCondition = ((ChangeableComponents)changeableId).StopCondition; _dataGenerator = ((ChangeableComponents)changeableId).DataGenerator; _triggers = ((ChangeableComponents)changeableId).Triggers; _isPreCondition = ((ChangeableComponents)changeableId).IsPreCondition; } else if (changeableId != null) throw new ArgumentException ("Unexpected changeable id"); }