Foobricator.Sources.Iterator.GetItem C# (CSharp) Method

GetItem() public method

Returns all items in the iterator. From Foobricator.Sources.ISource
public GetItem ( ) : object
return object
        public object GetItem()
        {
            return Items;
        }

Usage Example

Ejemplo n.º 1
0
        public void ThenNextMustUpdateDependentIterators()
        {
            var sources = new List<TestSource>
            {
                new TestSource{ Count = 0 },
                new TestSource{ Count = 100 }
            };

            using (var first = new Iterator(sources.Cast<object>().ToList(), null))
            using (var second = new Iterator(new List<object>{first}, null))
            {
                Assert.AreEqual(0, ((IList<object>)first.GetItem())[0]);
                Assert.AreEqual(100, ((IList<object>)first.GetItem())[1]);

                Assert.AreEqual(0, ((IList<object>)second.GetItem())[0]);
                Assert.AreEqual(100, ((IList<object>)second.GetItem())[1]);

                Iterator.NextAll(Iterator.DefaultScope);

                Assert.AreEqual(1, ((IList<object>)first.GetItem())[0]);
                Assert.AreEqual(101, ((IList<object>)first.GetItem())[1]);

                Assert.AreEqual(1, ((IList<object>)second.GetItem())[0]);
                Assert.AreEqual(101, ((IList<object>)second.GetItem())[1]);
            }
        }
All Usage Examples Of Foobricator.Sources.Iterator::GetItem