public static void SetParamValueOnMatching(this IEnumerable<ParamViewModel> that, ParamViewModel updatedParam) { foreach (var param in that.Where(p => p.Name.Equals(updatedParam.Name, StringComparison.InvariantCultureIgnoreCase))) { param.Value = updatedParam.Value; } }
public void Changing_the_value_of_param_will_trigger_callback() { var p = new ParamViewModel(GetParam()); 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 ParamViewModel(GetParam()); p.Value = "val"; }
public static void SetParamValueOnMatching(this IEnumerable <ParamViewModel> that, ParamViewModel updatedParam) { foreach (var param in that.Where(p => p.Name.Equals(updatedParam.Name, StringComparison.InvariantCultureIgnoreCase))) { param.Value = updatedParam.Value; } }