Skip to content

Commit ab79856

Browse files
author
rstam
committed
CSHARP-660: Fix unit test to enable text search *before* creating text index.
1 parent 1e7f8ee commit ab79856

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

MongoDB.DriverUnitTests/MongoCollectionTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,11 +1458,6 @@ public void TestTextIndex()
14581458
{
14591459
if (_server.BuildInfo.Version >= new Version(2, 4, 0, 0))
14601460
{
1461-
if (_collection.Exists()) { _collection.Drop(); }
1462-
_collection.Insert(new BsonDocument("x", "The quick brown fox"));
1463-
_collection.Insert(new BsonDocument("x", "jumped over the fence"));
1464-
_collection.CreateIndex(new IndexKeysDocument("x", "text"));
1465-
14661461
var enableTextSearchCommand = new CommandDocument
14671462
{
14681463
{ "setParameter", 1 },
@@ -1471,6 +1466,11 @@ public void TestTextIndex()
14711466
var adminDatabase = _server.GetDatabase("admin");
14721467
adminDatabase.RunCommand(enableTextSearchCommand);
14731468

1469+
if (_collection.Exists()) { _collection.Drop(); }
1470+
_collection.Insert(new BsonDocument("x", "The quick brown fox"));
1471+
_collection.Insert(new BsonDocument("x", "jumped over the fence"));
1472+
_collection.CreateIndex(new IndexKeysDocument("x", "text"));
1473+
14741474
var textSearchCommand = new CommandDocument
14751475
{
14761476
{ "text", _collection.Name },

0 commit comments

Comments
 (0)