Esempio n. 1
0
        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);

            takingWhile.ValidateConsistency();
            items[index].IsActive = newValue;
            takingWhile.ValidateConsistency();
        }
Esempio n. 2
0
        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);

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

            takingWhile.ValidateConsistency();
            takingWhile2.ValidateConsistency();

            param.Value = true;

            takingWhile.ValidateConsistency();
            takingWhile2.ValidateConsistency();
        }
Esempio n. 3
0
        public void TakingWhile_Set(
            [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 itemNew)
        {
            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.ValidateConsistency();
            items[index] = new Item(itemNew);
            takingWhile.ValidateConsistency();
            consumer.Dispose();
        }
Esempio n. 4
0
        public void TakingWhile_Insert1(
            [Values(true, false)] bool newValue)
        {
            ObservableCollection <Item> items = new ObservableCollection <Item>(

                );

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

            takingWhile.ValidateConsistency();
            items.Insert(0, new Item(newValue));
            takingWhile.ValidateConsistency();
        }
Esempio n. 5
0
        public void TakingWhile_Initialization_01()
        {
            ObservableCollection <Item> items = new ObservableCollection <Item>();

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

            takingWhile.ValidateConsistency();
        }
Esempio n. 6
0
        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);

            takingWhile.ValidateConsistency();
            items.RemoveAt(0);
            takingWhile.ValidateConsistency();
        }
Esempio n. 7
0
        public void TakingWhile_Change1(
            [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.ValidateConsistency();
            items[0].IsActive = !items[0].IsActive;
            takingWhile.ValidateConsistency();
            consumer.Dispose();
        }
        public void TakingWhile_Initialization_01()
        {
            ObservableCollection <Item> items = new ObservableCollection <Item>();

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

            takingWhile.ValidateConsistency();
            consumer.Dispose();
        }