Skip to content

Commit 08b6947

Browse files
sanych-sunrstam
authored andcommitted
CSHARP-4627: Ignore UnionWith tests on servers prior to 4.4 (#1082)
1 parent c9e1e28 commit 08b6947

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/MongoDB.Driver.Tests/Linq/Linq3ImplementationTests/Translators/ExpressionToPipelineTranslators/UnionMethodToPipelineTranslatorTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
using System.Linq;
1717
using FluentAssertions;
18+
using MongoDB.Driver.Core.Misc;
19+
using MongoDB.Driver.Core.TestHelpers.XunitExtensions;
1820
using Xunit;
1921

2022
namespace 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

Comments
 (0)