File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System . Linq ;
2
+ using System . Reflection ;
3
+ using FluentAssertions ;
4
+ using Nest ;
5
+ using Nest . Aggregations . Visitor ;
6
+ using Tests . Framework ;
7
+
8
+ namespace Tests . Aggregations
9
+ {
10
+ public class AggregationVisitorTests
11
+ {
12
+ [ U ]
13
+ public void VisitMethodForEachTypeOfAggregation ( )
14
+ {
15
+ var aggregationTypes =
16
+ from t in typeof ( IAggregation ) . Assembly ( ) . Types ( )
17
+ where typeof ( IAggregation ) . IsAssignableFrom ( t )
18
+ where t . IsInterface ( )
19
+ select t ;
20
+
21
+ var visitorMethodParameters =
22
+ from m in typeof ( IAggregationVisitor ) . GetTypeInfo ( ) . DeclaredMethods
23
+ where m . Name == "Visit"
24
+ let aggregationInterface = m . GetParameters ( ) . First ( ) . ParameterType
25
+ where aggregationInterface != typeof ( IAggregationContainer )
26
+ select aggregationInterface ;
27
+
28
+ visitorMethodParameters . Except ( aggregationTypes ) . Should ( ) . BeEmpty ( ) ;
29
+ }
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments