Exemple #1
0
        public void ExecuteAsync_should_throw_when_binding_is_null()
        {
            var subject = new FindOpcodeOperation <BsonDocument>(_collectionNamespace, BsonDocumentSerializer.Instance, _messageEncoderSettings);

            Func <Task> action = () => subject.ExecuteAsync(binding: null, CancellationToken.None);

            action.ShouldThrow <ArgumentNullException>().And.ParamName.Should().Be("binding");
        }
Exemple #2
0
            public async Task <BsonDocument> ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)
            {
                var cursor = await _explainOperation.ExecuteAsync(binding, cancellationToken).ConfigureAwait(false);

                var documents = await cursor.ToListAsync(cancellationToken).ConfigureAwait(false);

                return(documents.Single());
            }