public void TakingWhile_Change(
            [Values(true, false)] bool item0,
            [Values(true, false)] bool item1,
            [Values(true, false)] bool item2,
            [Values(true, false)] bool item3,
            [Values(true, false)] bool item4,
            [Range(0, 4, 1)] int index,
            [Values(true, false)] bool newValue)
        {
            ObservableCollection <Item> items = new ObservableCollection <Item>(
                new[]
            {
                new Item(item0),
                new Item(item1),
                new Item(item2),
                new Item(item3),
                new Item(item4)
            }

                );

            TakingWhile <Item> takingWhile = items.TakingWhile(item => item.IsActive).For(consumer);

            takingWhile.ValidateInternalConsistency();
            items[index].IsActive = newValue;
            takingWhile.ValidateInternalConsistency();
            consumer.Dispose();
        }
        public void SubExpessing()
        {
            Param param = new Param();
            ObservableCollection <Item> items = new ObservableCollection <Item>(
                new[]
            {
                new Item(true),
                new Item(false),
                new Item(true),
                new Item(false),
                new Item(true)
            }
                );

            TakingWhile <Item> takingWhile = items.TakingWhile(item =>
                                                               Expr.Is(() => param.Value
                                        ? (ObservableCollection <Item>)items.TakingWhile(item1 => true)
                                        : items.TakingWhile(item1 => item1.IsActive == item.IsActive)).Computing().Value.Count == 3).For(consumer);

            TakingWhile <Item> takingWhile2 = items.TakingWhile(item =>
                                                                (param.Value
                                        ? items.TakingWhile(item1 => true)
                                        : items.TakingWhile(item1 => item1.IsActive == item.IsActive)).Count == 3).For(consumer);

            takingWhile.ValidateInternalConsistency();
            takingWhile2.ValidateInternalConsistency();

            param.Value = true;

            takingWhile.ValidateInternalConsistency();
            takingWhile2.ValidateInternalConsistency();
            consumer.Dispose();
        }
        public void TakingWhile_Insert1(
            [Values(true, false)] bool newValue)
        {
            ObservableCollection <Item> items = new ObservableCollection <Item>(

                );

            TakingWhile <Item> takingWhile = items.TakingWhile(item => item.IsActive).For(consumer);

            takingWhile.ValidateInternalConsistency();
            items.Insert(0, new Item(newValue));
            takingWhile.ValidateInternalConsistency();
            consumer.Dispose();
        }
        public void TakingWhile_Initialization_01()
        {
            ObservableCollection <Item> items = new ObservableCollection <Item>();

            TakingWhile <Item> takingWhile = items.TakingWhile(item => item.IsActive).For(consumer);

            takingWhile.ValidateInternalConsistency();
            consumer.Dispose();
        }
        public void TakingWhile_Remove1(
            [Values(true, false)] bool item0)
        {
            ObservableCollection <Item> items = new ObservableCollection <Item>(
                new[]
            {
                new Item(item0)
            }

                );

            TakingWhile <Item> takingWhile = items.TakingWhile(item => item.IsActive).For(consumer);

            takingWhile.ValidateInternalConsistency();
            items.RemoveAt(0);
            takingWhile.ValidateInternalConsistency();
            consumer.Dispose();
        }