15
15
16
16
using System . Linq ;
17
17
using FluentAssertions ;
18
+ using MongoDB . Driver . Core . Misc ;
19
+ using MongoDB . Driver . Core . TestHelpers . XunitExtensions ;
18
20
using Xunit ;
19
21
20
22
namespace MongoDB . Driver . Tests . Linq . Linq3ImplementationTests . Translators . ExpressionToPipelineTranslators
@@ -39,6 +41,8 @@ public UnionMethodToPipelineTranslatorTests()
39
41
[ Fact ]
40
42
public void Union_should_combine_collections ( )
41
43
{
44
+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
45
+
42
46
var queryable = _firstCollection
43
47
. AsQueryable ( )
44
48
. Union ( _secondCollection . AsQueryable ( ) ) ;
@@ -53,6 +57,8 @@ public void Union_should_combine_collections()
53
57
[ Fact ]
54
58
public void Union_should_combine_collection_with_itself ( )
55
59
{
60
+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
61
+
56
62
var queryable = _firstCollection
57
63
. AsQueryable ( )
58
64
. Union ( _firstCollection . AsQueryable ( ) ) ;
@@ -67,6 +73,8 @@ public void Union_should_combine_collection_with_itself()
67
73
[ Fact ]
68
74
public void Union_should_combine_filtered_collections ( )
69
75
{
76
+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
77
+
70
78
var queryable = _firstCollection
71
79
. AsQueryable ( )
72
80
. Where ( c => c . Name . StartsWith ( "second" ) )
@@ -84,6 +92,8 @@ public void Union_should_combine_filtered_collections()
84
92
[ Fact ]
85
93
public void Union_should_support_projection ( )
86
94
{
95
+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
96
+
87
97
var queryable = _firstCollection
88
98
. AsQueryable ( )
89
99
. Where ( c => c . Name . StartsWith ( "second" ) )
@@ -103,6 +113,8 @@ public void Union_should_support_projection()
103
113
[ Fact ]
104
114
public void Union_should_support_projection_to_anonymous ( )
105
115
{
116
+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
117
+
106
118
var queryable = _firstCollection
107
119
. AsQueryable ( )
108
120
. Where ( c => c . Name . StartsWith ( "second" ) )
0 commit comments