public void Into_Dispatches_To_Objects_That_Implement_Reduce() { var obj = new Reducible { X = new[] { 1, 2, 3 } }; Assert.AreEqual(R.Into(new object[0], R.Map(R.Add(1)), obj), "Override"); Assert.AreEqual(R.Into(new object[0], R.Filter(isOdd), obj), "Override"); }
public void Transduce_Dispatches_To_Objects_That_Implement_Reduce() { var obj = new Reducible { X = new[] { 1, 2, 3 } }; Assert.AreEqual(R.Transduce(R.Map(R.Add(1)), R.Add(R.__), 0, obj), "override"); Assert.AreEqual(R.Transduce(R.Map(R.Add(1)), R.Add(R.__), 10, obj), "override"); }