File tree 3 files changed +40
-30
lines changed
src/FluentAssertions.Ioc.Ninject
3 files changed +40
-30
lines changed Original file line number Diff line number Diff line change @@ -24,35 +24,5 @@ public static IEnumerable<Type> GetAllInterfaces(this Assembly assembly)
24
24
{
25
25
return assembly . GetTypes ( ) . Where ( x => x . IsInterface ) ;
26
26
}
27
-
28
- /// <summary>
29
- /// Filters for just the types in the specified namespace.
30
- /// </summary>
31
- /// <typeparam name="T">The namespace of this type.</typeparam>
32
- /// <param name="types">The types to filter.</param>
33
- public static IEnumerable < Type > InNamespaceOf < T > ( this IEnumerable < Type > types )
34
- {
35
- return types . Where ( x => x . Namespace == typeof ( T ) . Namespace ) ;
36
- }
37
-
38
- /// <summary>
39
- /// Filters to exclude the specified type.
40
- /// </summary>
41
- /// <typeparam name="T">The type to exclude.</typeparam>
42
- /// <param name="types">The types to filter.</param>
43
- public static IEnumerable < Type > Excluding < T > ( this IEnumerable < Type > types )
44
- {
45
- return types . Where ( x => x . Name != typeof ( T ) . Name ) ;
46
- }
47
-
48
- /// <summary>
49
- /// Filters to only include types where the type name ends with the specified string.
50
- /// </summary>
51
- /// <param name="types">The types to filter.</param>
52
- /// <param name="endingWith">The ending with string.</param>
53
- public static IEnumerable < Type > EndingWith ( this IEnumerable < Type > types , string endingWith )
54
- {
55
- return types . Where ( x => x . Name . EndsWith ( endingWith ) ) ;
56
- }
57
27
}
58
28
}
Original file line number Diff line number Diff line change 61
61
<Compile Include =" KernelExtensions.cs" />
62
62
<Compile Include =" Properties\AssemblyInfo.cs" />
63
63
<Compile Include =" SingleTypeKernelAssertions.cs" />
64
+ <Compile Include =" TypeExtensions.cs" />
64
65
</ItemGroup >
65
66
<ItemGroup >
66
67
<None Include =" FluentAssertions.Ioc.Ninject.nuspec" />
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+
5
+ namespace FluentAssertions . Ioc . Ninject
6
+ {
7
+ public static class TypeExtensions
8
+ {
9
+ /// <summary>
10
+ /// Filters for just the types in the specified namespace.
11
+ /// </summary>
12
+ /// <typeparam name="T">The namespace of this type.</typeparam>
13
+ /// <param name="types">The types to filter.</param>
14
+ public static IEnumerable < Type > InNamespaceOf < T > ( this IEnumerable < Type > types )
15
+ {
16
+ return types . Where ( x => x . Namespace == typeof ( T ) . Namespace ) ;
17
+ }
18
+
19
+ /// <summary>
20
+ /// Filters to exclude the specified type.
21
+ /// </summary>
22
+ /// <typeparam name="T">The type to exclude.</typeparam>
23
+ /// <param name="types">The types to filter.</param>
24
+ public static IEnumerable < Type > Excluding < T > ( this IEnumerable < Type > types )
25
+ {
26
+ return types . Where ( x => x . Name != typeof ( T ) . Name ) ;
27
+ }
28
+
29
+ /// <summary>
30
+ /// Filters to only include types where the type name ends with the specified string.
31
+ /// </summary>
32
+ /// <param name="types">The types to filter.</param>
33
+ /// <param name="endingWith">The ending with string.</param>
34
+ public static IEnumerable < Type > EndingWith ( this IEnumerable < Type > types , string endingWith )
35
+ {
36
+ return types . Where ( x => x . Name . EndsWith ( endingWith ) ) ;
37
+ }
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments