public static void SetParamValueOnMatching(this IEnumerable<Param> that, Param updatedParam) { foreach (var param in that.Where(p => p.Name.EqualsIC(updatedParam.Name))) { param.Value = updatedParam.Value; } }
public void Get_parsed_arguments() { var p = new Param(typeof(string), "name", new ArgumentWithOptions(new ArgumentParameter("name", new[] { "name" }))); var c = new[]{ p }.GetParsedArguments(); Assert.That(c.RecognizedArguments.Count(), Is.EqualTo(0)); Assert.That(c.UnRecognizedArguments.Count(), Is.EqualTo(0)); Assert.That(c.ArgumentWithOptions.Count(), Is.EqualTo(1)); }
public void Changing_the_value_of_param_will_trigger_callback() { var p = new Param(typeof(string), "name", new ArgumentWithOptions(new ArgumentParameter("name", new []{"name"}))); bool triggered = false; p.PropertyChanged += (s, arg) => { triggered = true; }; p.Value = "val"; Assert.That(triggered); }
public void Changing_the_value_of_param_without_callback() { var p = new Param(typeof(string), "name", new ArgumentWithOptions(new ArgumentParameter("name", new[] { "name" }))); p.Value = "val"; }