Exemplo n.º 1
0
        public void Where_FilterContainsAConstant_CorrectlyFiltered()
        {
            Person person = new Person("Ninja", 20);

            ReadOnlyContinuousCollection<Person> peopleMatchingAge = person.GetPeopleWithSameAge(_source);

            Assert.AreEqual(1, peopleMatchingAge.Count);
        }
Exemplo n.º 2
0
        public void Where_FilterContainsAConstant_CorrectlyFiltered()
        {
            Person person = new Person("Ninja", 20);

            ReadOnlyContinuousCollection <Person> peopleMatchingAge = person.GetPeopleWithSameAge(_source);

            Assert.AreEqual(1, peopleMatchingAge.Count);
        }
Exemplo n.º 3
0
        public void Where_FilterContainsAConstantWithPropertyChangingOnConstant_CorrectResultsReturned()
        {
            Person person = new Person("Ninja", 20);

            ReadOnlyContinuousCollection<Person> peopleMatchingAge = person.GetPeopleWithSameAge(_source);

            int callCount = 0;
            peopleMatchingAge.CollectionChanged += (sender, args) => callCount++;

            person.Age = 10;

            Assert.AreEqual(2, callCount); // one remove and one add
            Assert.AreEqual(1, peopleMatchingAge.Count);
        }
Exemplo n.º 4
0
        public void Where_FilterContainsAConstantWithPropertyChangingOnConstant_CorrectResultsReturned()
        {
            Person person = new Person("Ninja", 20);

            ReadOnlyContinuousCollection <Person> peopleMatchingAge = person.GetPeopleWithSameAge(_source);

            int callCount = 0;

            peopleMatchingAge.CollectionChanged += (sender, args) => callCount++;

            person.Age = 10;

            Assert.AreEqual(2, callCount); // one remove and one add
            Assert.AreEqual(1, peopleMatchingAge.Count);
        }