public static void ClosedDelegateForProperty() { var d = DelegateHelpers.CreateClosedDelegateFactory <Func <int> >(() => "".Length).Invoke("abcd"); Equal(4, d()); }
public static void ClosedDelegate() { var d = DelegateHelpers.CreateClosedDelegateFactory <Func <char, int, int> >((ch, startIndex) => "".IndexOf(ch, startIndex)).Invoke("abc"); Equal(1, d('b', 0)); }