1515
1616using System . Linq ;
1717using FluentAssertions ;
18+ using MongoDB . Driver . Core . Misc ;
19+ using MongoDB . Driver . Core . TestHelpers . XunitExtensions ;
1820using Xunit ;
1921
2022namespace MongoDB . Driver . Tests . Linq . Linq3ImplementationTests . Translators . ExpressionToPipelineTranslators
@@ -39,6 +41,8 @@ public UnionMethodToPipelineTranslatorTests()
3941 [ Fact ]
4042 public void Union_should_combine_collections ( )
4143 {
44+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
45+
4246 var queryable = _firstCollection
4347 . AsQueryable ( )
4448 . Union ( _secondCollection . AsQueryable ( ) ) ;
@@ -53,6 +57,8 @@ public void Union_should_combine_collections()
5357 [ Fact ]
5458 public void Union_should_combine_collection_with_itself ( )
5559 {
60+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
61+
5662 var queryable = _firstCollection
5763 . AsQueryable ( )
5864 . Union ( _firstCollection . AsQueryable ( ) ) ;
@@ -67,6 +73,8 @@ public void Union_should_combine_collection_with_itself()
6773 [ Fact ]
6874 public void Union_should_combine_filtered_collections ( )
6975 {
76+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
77+
7078 var queryable = _firstCollection
7179 . AsQueryable ( )
7280 . Where ( c => c . Name . StartsWith ( "second" ) )
@@ -84,6 +92,8 @@ public void Union_should_combine_filtered_collections()
8492 [ Fact ]
8593 public void Union_should_support_projection ( )
8694 {
95+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
96+
8797 var queryable = _firstCollection
8898 . AsQueryable ( )
8999 . Where ( c => c . Name . StartsWith ( "second" ) )
@@ -103,6 +113,8 @@ public void Union_should_support_projection()
103113 [ Fact ]
104114 public void Union_should_support_projection_to_anonymous ( )
105115 {
116+ RequireServer . Check ( ) . Supports ( Feature . AggregateUnionWith ) ;
117+
106118 var queryable = _firstCollection
107119 . AsQueryable ( )
108120 . Where ( c => c . Name . StartsWith ( "second" ) )
0 commit comments