Skip to content

Commit 3a2a09d

Browse files
Fix wildcardProjection tests. (#1047)
1 parent 320743b commit 3a2a09d

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

tests/MongoDB.Driver.Legacy.Tests/Builders/IndexKeysBuilderTests.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,7 @@ public void CreateIndex_with_wildcardProjection_should_create_expected_index()
7070
var index = indexes.RawDocuments.Single(i => i["name"].AsString == "custom");
7171

7272
index["key"]["$**"].AsInt32.Should().Be(1);
73-
var serverVersion = CoreTestConfiguration.ServerVersion;
74-
if (serverVersion >= new SemanticVersion(4, 5, 0, "") && serverVersion <= new SemanticVersion(6, 2, 0, ""))
75-
{
76-
index["wildcardProjection"].Should().Be(BsonDocument.Parse("{ _id : true }"));
77-
}
78-
else
79-
{
80-
index["wildcardProjection"].Should().Be(BsonDocument.Parse("{ _id : 1 }"));
81-
}
73+
index["wildcardProjection"].Should().Be(BsonDocument.Parse("{ _id : 1 }"));
8274
}
8375

8476
[Fact]

tests/MongoDB.Driver.Legacy.Tests/Builders/IndexKeysBuilderTypedTests.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,7 @@ public void CreateIndex_with_wildcardProjection_should_create_expected_index()
8989
var indexes = collection.GetIndexes();
9090
var index = indexes.RawDocuments.Single(i => i["name"].AsString == "custom");
9191
index["key"]["$**"].AsInt32.Should().Be(1);
92-
var serverVersion = CoreTestConfiguration.ServerVersion;
93-
if (serverVersion >= new SemanticVersion(4, 5, 0, "") && serverVersion <= new SemanticVersion(6, 2, 0, ""))
94-
{
95-
index["wildcardProjection"].Should().Be(BsonDocument.Parse("{ b : true, _id : false }"));
96-
}
97-
else
98-
{
99-
index["wildcardProjection"].Should().Be(BsonDocument.Parse("{ b : 1, _id : 0 }"));
100-
}
92+
index["wildcardProjection"].Should().Be(BsonDocument.Parse("{ b : 1, _id : 0 }"));
10193
}
10294

10395
[Fact]

0 commit comments

Comments
 (0)