public void AppendValue() { ForEach.In(1, 2).Append(3) .SequenceEqual(ForEach.In(1, 2, 3)) .Should() .BeTrue(); }
public void PrependValue() { 1.PrependTo(ForEach.In(2, 3)) .SequenceEqual(ForEach.In(1, 2, 3)) .Should() .BeTrue(); }
public void SkipIndexOfArray() { new int[] { 1, 2, 3 } .ExceptIndex(1) .SequenceEqual(ForEach.In(1, 3)) .Should() .BeTrue(); }
public void PairSelectorResults() { ForEach.In(1, 2, 3) .PairedWith(i => i.ToString()) .All(ir => int.Parse(ir.result) == ir.item) .Should() .BeTrue(); }
public void FilterByType() { ForEach.In <object>(1, "2", 3) .WhereIs <int>() .SequenceEqual(ForEach.In(1, 3)) .Should() .BeTrue(); }
public void SkipIndexOfEnumerable() { ForEach.In(1, 2, 3) .ExceptIndex(1) .SequenceEqual(ForEach.In(1, 3)) .Should() .BeTrue(); }
public void SkipIndexOfList() { new List <int> { 1, 2, 3 } .ExceptIndex(1) .SequenceEqual(ForEach.In(1, 3)) .Should() .BeTrue(); }
public void CompleteActionForEachItem() { var list = new List <int>(); ForEach.In(1, 2, 3).Do(i => list.Add(i * 2)) .SequenceEqual(ForEach.In(1, 2, 3)) .Should() .BeTrue(); list.SequenceEqual(ForEach.In(2, 4, 6)) .Should() .BeTrue(); }