public object Apply(object arg) { EnumerateIterator.Tuple providerTuple = (EnumerateIterator.Tuple)arg; IFixtureProvider provider = (IFixtureProvider)providerTuple.value; int wantedIndex = combination[providerTuple.index]; return(Iterators.Map(Iterators.Enumerate(provider), new _IFunction4_59(wantedIndex , provider))); }
public object Apply(object arg) { EnumerateIterator.Tuple tuple = (EnumerateIterator.Tuple)arg; if (tuple.index != wantedIndex) { return(Iterators.Skip); } return(new FixtureDecorator(provider.Variable(), tuple.value, tuple.index)); }
public virtual void TestEnumerate() { IEnumerable e = Iterators.Enumerate(Iterators.Iterable(new object[] { "1", "2" }) ); IEnumerator iterator = e.GetEnumerator(); EnumerateIterator.Tuple first = (EnumerateIterator.Tuple)Iterators.Next(iterator); EnumerateIterator.Tuple second = (EnumerateIterator.Tuple)Iterators.Next(iterator ); Assert.AreEqual(0, first.index); Assert.AreEqual("1", first.value); Assert.AreEqual(1, second.index); Assert.AreEqual("2", second.value); Assert.IsFalse(iterator.MoveNext()); }
public object Apply(object arg) { EnumerateIterator.Tuple tuple = (EnumerateIterator.Tuple)arg; return(new FixtureDecorator(provider.Variable(), tuple.value, tuple.index)); }