SPRNET-1536 replace Predicate<T> with Func<T, bool> and replace custsom LINQ extensions with actual LINQ now that we're on .NET 3.5 or later

This commit is contained in:
Steve Bohlen
2013-01-13 18:53:41 -05:00
parent e4a59c6dd4
commit de4f7d6e1f
11 changed files with 56 additions and 223 deletions

View File

@@ -1,30 +0,0 @@
#region License
/*
* Copyright <20> 2010-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
using NUnit.Framework;
namespace Spring.Context.Attributes
{
[TestFixture]
public class AssemblyObjectDefinitionScannerTests
{
}
}

View File

@@ -108,25 +108,25 @@ namespace Spring.Context.Attributes
private AssemblyObjectDefinitionScanner _scanner;
private List<Predicate<Type>> ExcludePredicates
private List<Func<Type, bool>> ExcludePredicates
{
get
{
//get at the collection of excludePredicates from the private field
//(yuck!-- test smell, but at least its wrapped up in a neat private property getter!)
return
(List<Predicate<Type>>) (ReflectionUtils.GetInstanceFieldValue(_scanner, "TypeExclusionPredicates"));
(List<Func<Type, bool>>) (ReflectionUtils.GetInstanceFieldValue(_scanner, "TypeExclusionPredicates"));
}
}
private List<Predicate<Type>> IncludePredicates
private List<Func<Type, bool>> IncludePredicates
{
get
{
//get at the collection of includePredicates from the private field
//(yuck!-- test smell, but at least its wrapped up in a neat private property getter!)
return
(List<Predicate<Type>>) (ReflectionUtils.GetInstanceFieldValue(_scanner, "TypeInclusionPredicates"));
(List<Func<Type, bool>>) (ReflectionUtils.GetInstanceFieldValue(_scanner, "TypeInclusionPredicates"));
}
}

View File

@@ -153,7 +153,6 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Context\Attributes\AbstractConfigurationClassPostProcessorTests.cs" />
<Compile Include="Context\Attributes\AssemblyObjectDefinitionScannerTests.cs" />
<Compile Include="Context\Attributes\AssemblyTypeScannerTests.cs" />
<Compile Include="Context\Attributes\CodeConfigApplicationContextTests.cs" />
<Compile Include="Context\Attributes\ConfigurationClassObjectDefinitionReaderTests.cs" />