public object Transform(OptimusPrime operatoor, string value) { var session = ScenarioContext.Current.Get<Dictionary<string, object>>(SpecDriverCommonConstants.SessionKey, true); if (session.ContainsKey(Key)) { return session[Key]; } return value; }
public object Transform(OptimusPrime operatoor, string value) { Type = Result.Groups[1].Value; Property = Result.Groups[2].Value; var name = string.Join("_", ContextKey, Type); var item = ScenarioContext.Current.Get<object>(name); if (item != null) { return item.GetProperty(Property); } return value; }
public object Transform(OptimusPrime operatoor, string value) { return JsonConvert.DeserializeObject(value.Trim()); }
public object Transform(OptimusPrime operatoor, string value) { return Content.Select(x => operatoor.Tranform(x.Trim())); }
public object Transform(OptimusPrime operatoor, string value) { return value.Replace(Lookup, Guid.NewGuid().ToString()); }
public object Transform(OptimusPrime operatoor, string value) { return Success ? Content : default(bool); }
public object Transform(OptimusPrime operatoor, string value) { var generator = new RandomStringGenerator(UseSpecialCharacters:false); return generator.Generate(15); }
/// <summary> /// Tries to convert strings into their respected types. /// </summary> /// <param name="value">Value to convert into object</param> /// <param name="delimiter">Defaults to :: but can be overriden. Default is not a comma as, it will not work with an array of objects (comma separated properties)</param> /// <returns></returns> public static object FromString(string value, string delimiter = "::") { var transformer = new OptimusPrime(); return transformer.Tranform(value); }