コード例 #1
0
ファイル: WhereTest.cs プロジェクト: ismell/Continuous-LINQ
        public void Where_FilterContainsAConstant_CorrectlyFiltered()
        {
            Person person = new Person("Ninja", 20);

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

            Assert.AreEqual(1, peopleMatchingAge.Count);
        }
コード例 #2
0
ファイル: WhereTest.cs プロジェクト: git-thinh/clinq
        public void Where_FilterContainsAConstant_CorrectlyFiltered()
        {
            Person person = new Person("Ninja", 20);

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

            Assert.AreEqual(1, peopleMatchingAge.Count);
        }
コード例 #3
0
ファイル: WhereTest.cs プロジェクト: ismell/Continuous-LINQ
        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);
        }
コード例 #4
0
ファイル: WhereTest.cs プロジェクト: git-thinh/clinq
        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);
        }