Beispiel #1
0
        public void ComparableIndexLookupWithGreaterThanOrEqualTo()
        {
            SimpleClass[] someItems =
            {
                new SimpleClass {
                    Name = "Jason", Age = 25
                },
                new SimpleClass {
                    Name = "Aaron", Age = 37
                },
                new SimpleClass {
                    Name = "Erin", Age = 34
                },
                new SimpleClass {
                    Name = "Adriana", Age = 13
                },
            };
            var indexOnSomeItems =
                new ComparisonIndex <SimpleClass, int>(
                    someItems,
                    typeof(SimpleClass).GetProperty("Age"));
            var olderThan34Or34 = indexOnSomeItems.WhereThroughIndex(item => item.Age >= 34);

            Assert.AreEqual(2, olderThan34Or34.Count());
        }
Beispiel #2
0
		public void ComparableIndexLookupWithGreaterThanOrEqualTo()
		{
			SimpleClass[] someItems = {
																new SimpleClass {Name = "Jason", Age = 25},
																new SimpleClass {Name = "Aaron", Age = 37},
																new SimpleClass {Name = "Erin", Age=34},
																new SimpleClass {Name = "Adriana", Age=13},
														};
			var indexOnSomeItems =
					new ComparisonIndex<SimpleClass, int>(
							someItems,
							typeof(SimpleClass).GetProperty("Age"));
			var olderThan34Or34 = indexOnSomeItems.WhereThroughIndex(item => item.Age >= 34);
			Assert.AreEqual(2, olderThan34Or34.Count());
		}