Esempio n. 1
0
            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)));
            }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        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());
        }
Esempio n. 4
0
 public object Apply(object arg)
 {
     EnumerateIterator.Tuple tuple = (EnumerateIterator.Tuple)arg;
     return(new FixtureDecorator(provider.Variable(), tuple.value, tuple.index));
 }