public void ChangeStream_should_add_the_expected_stage_when_options_is_null() { var pipeline = new EmptyPipelineDefinition <BsonDocument>(); ChangeStreamStageOptions options = null; var result = pipeline.ChangeStream(options); var stages = RenderStages(result); stages.Count.Should().Be(1); stages[0].Should().Be("{ $changeStream : { fullDocument : \"default\" } }"); }
public void ChangeStream_should_add_the_expected_stage( ChangeStreamFullDocumentOption fullDocument, string resumeAfterString, string expectedStage) { var resumeAfter = resumeAfterString == null ? null : BsonDocument.Parse(resumeAfterString); var pipeline = new EmptyPipelineDefinition <BsonDocument>(); var options = new ChangeStreamStageOptions { FullDocument = fullDocument, ResumeAfter = resumeAfter }; var result = pipeline.ChangeStream(options); var stages = RenderStages(result); stages.Count.Should().Be(1); stages[0].Should().Be(expectedStage); }