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]);
}
}