Skip to content

Commit 740fe75

Browse files
committed
- Test fix
1 parent 23c0710 commit 740fe75

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/MongoDB.Driver.Tests/PipelineDefinitionBuilderTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void Search_should_add_expected_stage()
123123
{
124124
var pipeline = new EmptyPipelineDefinition<BsonDocument>();
125125
var builder = new SearchDefinitionBuilder<BsonDocument>();
126-
var result = pipeline.Search(builder.Text("foo", "bar"));
126+
var result = pipeline.Search(builder.Text("bar", "foo"));
127127
var stages = RenderStages(result, BsonDocumentSerializer.Instance);
128128
stages[0].Should().Be(
129129
BsonDocument.Parse("{ $search: { text: { query: 'foo', path: 'bar' } } }"));
@@ -134,7 +134,7 @@ public void Search_should_add_expected_stage_with_highlight()
134134
{
135135
var pipeline = new EmptyPipelineDefinition<BsonDocument>();
136136
var builder = new SearchDefinitionBuilder<BsonDocument>();
137-
var result = pipeline.Search(builder.Text("foo", "bar"), new SearchHighlightOptions<BsonDocument>("foo"));
137+
var result = pipeline.Search(builder.Text("bar", "foo"), new SearchHighlightOptions<BsonDocument>("foo"));
138138
var stages = RenderStages(result, BsonDocumentSerializer.Instance);
139139
stages[0].Should().BeEquivalentTo(
140140
BsonDocument.Parse("{ $search: { text: { query: 'foo', path: 'bar' }, highlight: { path: 'foo' } } }"));
@@ -145,7 +145,7 @@ public void Search_should_add_expected_stage_with_index()
145145
{
146146
var pipeline = new EmptyPipelineDefinition<BsonDocument>();
147147
var builder = new SearchDefinitionBuilder<BsonDocument>();
148-
var result = pipeline.Search(builder.Text("foo", "bar"), indexName: "foo");
148+
var result = pipeline.Search(builder.Text("bar", "foo"), indexName: "foo");
149149
var stages = RenderStages(result, BsonDocumentSerializer.Instance);
150150
stages[0].Should().Be(
151151
BsonDocument.Parse("{ $search: { text: { query: 'foo', path: 'bar' }, index: 'foo' } }"));
@@ -160,7 +160,7 @@ public void Search_should_add_expected_stage_with_count()
160160
{
161161
Type = SearchCountType.Total
162162
};
163-
var result = pipeline.Search(builder.Text("foo", "bar"), count: count);
163+
var result = pipeline.Search(builder.Text("bar", "foo"), count: count);
164164
var stages = RenderStages(result, BsonDocumentSerializer.Instance);
165165
stages[0].Should().Be(
166166
BsonDocument.Parse("{ $search: { text: { query: 'foo', path: 'bar' }, count: { type: 'total' } } }"));
@@ -171,7 +171,7 @@ public void Search_should_add_expected_stage_with_return_stored_source()
171171
{
172172
var pipeline = new EmptyPipelineDefinition<BsonDocument>();
173173
var builder = new SearchDefinitionBuilder<BsonDocument>();
174-
var result = pipeline.Search(builder.Text("foo", "bar"), returnStoredSource: true);
174+
var result = pipeline.Search(builder.Text("bar", "foo"), returnStoredSource: true);
175175
var stages = RenderStages(result, BsonDocumentSerializer.Instance);
176176
stages[0].Should().Be(
177177
BsonDocument.Parse("{ $search: { text: { query: 'foo', path: 'bar' }, returnStoredSource: true } }"));
@@ -182,7 +182,7 @@ public void Search_should_throw_when_pipeline_is_null()
182182
{
183183
PipelineDefinition<BsonDocument, BsonDocument> pipeline = null;
184184
var builder = new SearchDefinitionBuilder<BsonDocument>();
185-
var exception = Record.Exception(() => pipeline.Search(builder.Text("foo", "bar")));
185+
var exception = Record.Exception(() => pipeline.Search(builder.Text("bar", "foo")));
186186
exception.Should().BeOfType<ArgumentNullException>()
187187
.Which.ParamName.Should().Be("pipeline");
188188
}
@@ -201,7 +201,7 @@ public void SearchMeta_should_add_expected_stage()
201201
{
202202
var pipeline = new EmptyPipelineDefinition<BsonDocument>();
203203
var builder = new SearchDefinitionBuilder<BsonDocument>();
204-
var result = pipeline.SearchMeta(builder.Text("foo", "bar"));
204+
var result = pipeline.SearchMeta(builder.Text("bar", "foo"));
205205
var stages = RenderStages(result, BsonDocumentSerializer.Instance);
206206
stages[0].Should().Be(
207207
BsonDocument.Parse("{ $searchMeta: { text: { query: 'foo', path: 'bar' } } }"));
@@ -212,7 +212,7 @@ public void SearchMeta_should_add_expected_stage_with_index()
212212
{
213213
var pipeline = new EmptyPipelineDefinition<BsonDocument>();
214214
var builder = new SearchDefinitionBuilder<BsonDocument>();
215-
var result = pipeline.SearchMeta(builder.Text("foo", "bar"), indexName: "foo");
215+
var result = pipeline.SearchMeta(builder.Text("bar", "foo"), indexName: "foo");
216216
var stages = RenderStages(result, BsonDocumentSerializer.Instance);
217217
stages[0].Should().Be(
218218
BsonDocument.Parse("{ $searchMeta: { text: { query: 'foo', path: 'bar' }, index: 'foo' } }"));
@@ -227,7 +227,7 @@ public void SearchMeta_should_add_expected_stage_with_count()
227227
{
228228
Type = SearchCountType.Total
229229
};
230-
var result = pipeline.SearchMeta(builder.Text("foo", "bar"), count: count);
230+
var result = pipeline.SearchMeta(builder.Text("bar", "foo"), count: count);
231231
var stages = RenderStages(result, BsonDocumentSerializer.Instance);
232232
stages[0].Should().Be(
233233
BsonDocument.Parse("{ $searchMeta: { text: { query: 'foo', path: 'bar' }, count: { type: 'total' } } }"));
@@ -238,7 +238,7 @@ public void SearchMeta_should_throw_when_pipeline_is_null()
238238
{
239239
PipelineDefinition<BsonDocument, BsonDocument> pipeline = null;
240240
var builder = new SearchDefinitionBuilder<BsonDocument>();
241-
var exception = Record.Exception(() => pipeline.SearchMeta(builder.Text("foo", "bar")));
241+
var exception = Record.Exception(() => pipeline.SearchMeta(builder.Text("bar", "foo")));
242242
exception.Should().BeOfType<ArgumentNullException>()
243243
.Which.ParamName.Should().Be("pipeline");
244244
}

0 commit comments

Comments
 (0)