Esempio n. 1
0
 public void SetUp()
 {
     _source         = ClinqTestFactory.CreateSixPersonSource();
     _source[1].Age  = 20; // same as _source[2].age
     _source[2].Age  = 20;
     _source[1].Name = "Zoolander";
     _source[2].Name = "Alfonse";
 }
        public void ResetSecond_Always_LeavesOutputIntact()
        {
            var people = ClinqTestFactory.CreateSixPersonSource();

            var first  = new TestContinuousCollection <Person>(people.ToList());
            var second = new TestContinuousCollection <Person> {
                people[0]
            };

            _target = new ExceptReadOnlyContinuousCollection <Person>(first, second);

            second.FireReset();

            Assert.AreEqual(5, _target.Count);
            CollectionAssert.AreEquivalent(people.Skip(1), _target.Output);
        }
        public void ResetFirst_Always_LeavesOutputIntact()
        {
            var people = ClinqTestFactory.CreateSixPersonSource();

            var first  = new TestContinuousCollection <Person>(people.ToList());
            var second = new TestContinuousCollection <Person> {
                people[0]
            };

            _target = new ConcatReadOnlyContinuousCollection <Person>(first, second);

            first.FireReset();

            Assert.AreEqual(7, _target.Count);
            var expectedConcatenation = Concatenate(first, second);

            CollectionAssert.AreEquivalent(expectedConcatenation, _target);
        }
        public void ResetOnSecond_Always_RaisesNotifyCollectionChangedWithResetAction()
        {
            var people = ClinqTestFactory.CreateSixPersonSource();

            var first  = new TestContinuousCollection <Person>(people.ToList());
            var second = new TestContinuousCollection <Person> {
                people[0]
            };

            _target = new ConcatReadOnlyContinuousCollection <Person>(first, second);

            var eventArgsList = new List <NotifyCollectionChangedEventArgs>();

            _target.CollectionChanged += (sender, e) => eventArgsList.Add(e);

            second.FireReset();

            Assert.AreEqual(1, eventArgsList.Count);
            Assert.AreEqual(NotifyCollectionChangedAction.Reset, eventArgsList[0].Action);
        }
 protected void SetUp6PersonSource()
 {
     _source = new ContinuousCollection <Person>(ClinqTestFactory.CreateSixPersonSource().ToList());
     setupTargetAndHandlers();
 }
Esempio n. 6
0
 public void SetUp()
 {
     _source = ClinqTestFactory.CreateSixPersonSource();
 }