protected async Task <TResult> ExecuteOperationAsync <TResult>(IReadOperation <TResult> operation) { using (var binding = CoreTestConfiguration.GetReadBinding()) { return(await ExecuteOperationAsync(operation, binding)); } }
protected TResult ExecuteOperation <TResult>(IReadOperation <TResult> operation) { using (var binding = CoreTestConfiguration.GetReadBinding()) { return(operation.Execute(binding, CancellationToken.None)); } }
protected async Task <TResult> ExecuteOperationAsync <TResult>(IReadOperation <TResult> operation) { using (var binding = CoreTestConfiguration.GetReadBinding()) { return(await operation.ExecuteAsync(binding, CancellationToken.None)); } }
protected async Task <TResult> ExecuteOperationAsync <TResult>(IReadOperation <TResult> operation) { using (var binding = CoreTestConfiguration.GetReadBinding(_session.Fork())) using (var bindingHandle = new ReadBindingHandle(binding)) { return(await ExecuteOperationAsync(operation, bindingHandle)); } }
protected TResult ExecuteOperation <TResult>(IReadOperation <TResult> operation) { using (var binding = CoreTestConfiguration.GetReadBinding(_session.Fork())) using (var bindingHandle = new ReadBindingHandle(binding)) { return(operation.Execute(bindingHandle, CancellationToken.None)); } }
public async Task ExecuteAsync_should_return_expected_result() { var subject = new CountOperation(_collectionNamespace, _messageEncoderSettings); long result; using (var binding = CoreTestConfiguration.GetReadBinding()) { result = await subject.ExecuteAsync(binding, CancellationToken.None); } result.Should().Be(5); }
public async Task ExecuteAsync_should_return_expected_result_when_filter_is_provided() { var subject = new CountOperation(_collectionNamespace, _messageEncoderSettings); subject.Filter = BsonDocument.Parse("{ _id : { $gt : 1 } }"); long result; using (var binding = CoreTestConfiguration.GetReadBinding()) { result = await subject.ExecuteAsync(binding, CancellationToken.None); } result.Should().Be(4); }