public void SelectWillReturnResultsInCorrectSequence(Type type) { // Fixture setup IEnumerable<IMethod> modestConstructors = from ci in type.GetConstructors() let parameters = ci.GetParameters() orderby parameters.Length ascending select new ConstructorMethod(ci) as IMethod; IEnumerable<IMethod> greedyConstructors = from ci in type.GetConstructors() let parameters = ci.GetParameters() orderby parameters.Length descending select new ConstructorMethod(ci) as IMethod; var expectedConstructors = new List<IMethod>(); expectedConstructors.AddRange(modestConstructors); expectedConstructors.AddRange(greedyConstructors); var queries = new IMethodQuery[] { new DelegatingMethodQuery { OnSelectMethods = t => modestConstructors }, new DelegatingMethodQuery { OnSelectMethods = t => greedyConstructors }, new DelegatingMethodQuery() }; var sut = new CompositeMethodQuery(queries); // Exercise system var result = sut.SelectMethods(type); // Verify outcome Assert.True(expectedConstructors.SequenceEqual(result)); // Teardown }