Exemple #1
0
 public void Setup()
 {
     _source = ClinqTestFactory.CreateTwoPersonSource();
     _target = new SelectReadOnlyContinuousCollection <Person, string>(
         _source,
         p => p.Name);
 }
Exemple #2
0
 public void Setup()
 {
     _source = ClinqTestFactory.CreateTwoPersonSource();
     _target = new FilteringReadOnlyContinuousCollection <Person>(
         _source,
         p => p.Age > 10);
 }
        public void Construct_BothListsHaveValues_OutputHasItemsFromBothLists()
        {
            _second = ClinqTestFactory.CreateTwoPersonSource();
            _target = new ConcatReadOnlyContinuousCollection <Person>(_first, _second);

            var expectedConcatenation = ConcatenateFirstAndSecond();

            CollectionAssert.AreEquivalent(expectedConcatenation, _target);
        }
        public void Construct_FirstListIsEmpty_OutputIsSecondList()
        {
            _first  = new ObservableCollection <Person>();
            _second = ClinqTestFactory.CreateTwoPersonSource();

            _target = new ConcatReadOnlyContinuousCollection <Person>(_first, _second);

            CollectionAssert.AreEquivalent(_second, _target);
        }
        public void Setup()
        {
            _first  = ClinqTestFactory.CreateTwoPersonSource();
            _second = new ObservableCollection <Person>();

            _target = new ConcatReadOnlyContinuousCollection <Person>(_first, _second);

            _person1 = _first[0];
            _person2 = _first[1];
        }
Exemple #6
0
        public void ChangingItem_LastItemInGroup_GroupRemoved()
        {
            _source = ClinqTestFactory.CreateTwoPersonSource();

            var group = from p in _source group p by p.Name;

            _source[0].Name = "Foo";

            Assert.AreEqual(2, group.Count);
        }
Exemple #7
0
        public void AddItemToSource_ItemIsADuplicate_AddedToCorrectGroup()
        {
            _source = ClinqTestFactory.CreateTwoPersonSource();

            var group = from p in _source group p
                        by new { p.Name, p.Age };

            _source.Add(_source[0]);

            Assert.AreEqual(2, group.Count);
            Assert.AreEqual(2, group[0].Count);
        }
Exemple #8
0
        public void GroupBy_MultipleGroups_UsesAnonymouseTypeForComparison()
        {
            _source = ClinqTestFactory.CreateTwoPersonSource();

            var group = from p in _source group p by new { p.Name, p.Age };

            _source.Add(new Person("Bob", 10));
            _source.Add(new Person("Jim", 20));

            Assert.AreEqual(2, group.Count);
            Assert.AreEqual(2, group[group.Count - 1].Count);
        }
Exemple #9
0
        public void Setup()
        {
            _outer = ClinqTestFactory.CreateTwoPersonSource();
            _inner = ClinqTestFactory.CreateTwoPersonSource();

            _target = from outerPerson in _outer
                      join innerPerson in _inner on outerPerson.Age equals innerPerson.Age into innersMatchingOuterAge
                      select new Pair <Person, ReadOnlyContinuousCollection <Person> >(outerPerson, innersMatchingOuterAge);

            _standardLinqResults = from outerPerson in _outer.AsEnumerable()
                                   join innerPerson in _inner on outerPerson.Age equals innerPerson.Age into innersMatchingOuterAge
                                   select new Pair <Person, IEnumerable <Person> >(outerPerson, innersMatchingOuterAge);
        }
        public void Setup()
        {
            _source = ClinqTestFactory.CreateTwoPersonSource();

            _propertyAccessTree = new PropertyAccessTree();
            ParameterNode parameterNode = new ParameterNode(typeof(Person), "person");

            _propertyAccessTree.Children.Add(parameterNode);

            var agePropertyAccessNode = new PropertyAccessNode(typeof(Person).GetProperty("Age"));

            parameterNode.Children.Add(agePropertyAccessNode);

            _target = new NotifyCollectionChangedMonitor <Person>(_propertyAccessTree, _source);
        }
Exemple #11
0
 public void Setup()
 {
     _source = ClinqTestFactory.CreateTwoPersonSource();
 }
 protected void SetUp2PersonSource()
 {
     _source = new ContinuousCollection <Person>(ClinqTestFactory.CreateTwoPersonSource().ToList());
     setupTargetAndHandlers();
 }
        public void Setup()
        {
            _source = ClinqTestFactory.CreateTwoPersonSource();

            _target = new CollectionMonitor <Person>(_source);
        }
 public void Setup()
 {
     _source = ClinqTestFactory.CreateTwoPersonSource();
     _target = new PassThroughReadOnlyContinuousCollection <Person>(_source);
 }