public void getListMethodGroup() { var lg = new ListGetter(); var l = GeneralUtils.getList <string>(r => lg.get123(r)); Assert.AreEqual(new List <string> { "foo", "bar" }, l); }
/// <summary> /// Execute the command logic with specified data. /// </summary> /// <param name="data"><see cref="CommandData"/> passed over the network .</param> public override void Execute(CommandData data) { T[] values; if (ConverterArray != null) { values = ConverterArray(data); } else { values = data.GetAs <T[]>(); } ListGetter.Invoke(data).AddRange(values); }
/// <summary> /// Execute the command logic with specified data. /// </summary> /// <param name="data"><see cref="CommandData"/> passed over the network .</param> public override void Execute(CommandData data) { ListGetter.Invoke(data).RemoveAt(data.GetAs <int>()); }
/// <summary> /// Execute the command logic with specified data. /// </summary> /// <param name="data"><see cref="CommandData"/> passed over the network .</param> public override void Execute(CommandData data) { var args = data.GetAs <KeyValuePair <int, T> >(); ListGetter.Invoke(data).Insert(args.Key, args.Value); }
/// <summary> /// Execute the command logic with specified data. /// </summary> /// <param name="data"><see cref="CommandData"/> passed over the network .</param> public override void Execute(CommandData data) { var args = data.GetAs <ValueTuple <int, int> >(); ListGetter.Invoke(data).RemoveRange(args.Item1, args.Item2); }
/// <summary> /// Execute the command logic with specified data. /// </summary> /// <param name="data"><see cref="CommandData"/> passed over the network .</param> public override void Execute(CommandData data) { ListGetter.Invoke(data).Remove(GetElement(data)); }