From 82c573bb43692d540676c814c53988a5bef92fc6 Mon Sep 17 00:00:00 2001 From: rstam Date: Fri, 6 Oct 2023 09:17:34 -0700 Subject: [PATCH] CSHARP-4804: Fix some tests. --- .../ProjectionDefinitionBuilderTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/MongoDB.Driver.Tests/ProjectionDefinitionBuilderTests.cs b/tests/MongoDB.Driver.Tests/ProjectionDefinitionBuilderTests.cs index bc13efb3b01..641254af736 100644 --- a/tests/MongoDB.Driver.Tests/ProjectionDefinitionBuilderTests.cs +++ b/tests/MongoDB.Driver.Tests/ProjectionDefinitionBuilderTests.cs @@ -167,7 +167,7 @@ public void Slice() { var subject = CreateSubject(); - Assert(subject.Slice("a", 10), "{a: {$slice: 10}}"); + Assert(subject.Slice("a", 10), "{a: {$slice: ['$a', 10]}}"); } [Fact] @@ -175,8 +175,8 @@ public void Slice_Typed() { var subject = CreateSubject(); - Assert(subject.Slice(x => x.Pets, 10), "{pets: {$slice: 10}}"); - Assert(subject.Slice("Pets", 10), "{pets: {$slice: 10}}"); + Assert(subject.Slice(x => x.Pets, 10), "{pets: {$slice: ['$pets', 10]}}"); + Assert(subject.Slice("Pets", 10), "{pets: {$slice: ['$pets', 10]}}"); } [Fact] @@ -184,7 +184,7 @@ public void Slice_with_limit() { var subject = CreateSubject(); - Assert(subject.Slice("a", 10, 20), "{a: {$slice: [10, 20]}}"); + Assert(subject.Slice("a", 10, 20), "{a: {$slice: ['$a', 10, 20]}}"); } [Fact] @@ -192,8 +192,8 @@ public void Slice_Typed_with_limit() { var subject = CreateSubject(); - Assert(subject.Slice(x => x.Pets, 10, 20), "{pets: {$slice: [10, 20]}}"); - Assert(subject.Slice("Pets", 10, 20), "{pets: {$slice: [10, 20]}}"); + Assert(subject.Slice(x => x.Pets, 10, 20), "{pets: {$slice: ['$pets', 10, 20]}}"); + Assert(subject.Slice("Pets", 10, 20), "{pets: {$slice: ['$pets', 10, 20]}}"); } private void Assert(ProjectionDefinition projection, string expectedJson, LinqProvider linqProvider = LinqProvider.V3)