public void constructor_should_initialize_instance()
        {
            var result = new CurrentOpUsingFindOperation(_adminDatabaseNamespace, _messageEncoderSettings);

            result.DatabaseNamespace.Should().Be(_adminDatabaseNamespace);
            result.MessageEncoderSettings.Should().BeEquivalentTo(_messageEncoderSettings);
        }
        public void constructor_should_initialize_instance()
        {
            var result = new CurrentOpUsingFindOperation(_adminDatabaseNamespace, _messageEncoderSettings);

            result.DatabaseNamespace.Should().Be(_adminDatabaseNamespace);
            result.MessageEncoderSettings.Should().BeEquivalentTo(_messageEncoderSettings);
        }
        public async Task ExecuteAsync_should_return_expected_result()
        {
            var subject = new CurrentOpUsingFindOperation(_adminDatabaseNamespace, _messageEncoderSettings);
            using (var binding = new ReadPreferenceBinding(CoreTestConfiguration.Cluster, ReadPreference.PrimaryPreferred))
            {
                var result = await subject.ExecuteAsync(binding, CancellationToken.None);

                result.Contains("inprog");
            }
        }
        public void CreateOperation_should_return_expected_result()
        {
            var subject = new CurrentOpUsingFindOperation(_adminDatabaseNamespace, _messageEncoderSettings);

            var result = subject.CreateOperation();

            result.CollectionNamespace.Should().Be(new CollectionNamespace(_adminDatabaseNamespace, "$cmd.sys.inprog"));
            result.Limit.Should().Be(1);
            result.MessageEncoderSettings.Should().BeSameAs(_messageEncoderSettings);
            result.ResultSerializer.Should().BeSameAs(BsonDocumentSerializer.Instance);
        }
        public void Execute_should_return_expected_result()
        {
            RequireServer.Where(clusterTypes: ClusterTypes.StandaloneOrReplicaSet, storageEngines: "mmapv1");
            var subject = new CurrentOpUsingFindOperation(_adminDatabaseNamespace, _messageEncoderSettings);
            using (var binding = new ReadPreferenceBinding(CoreTestConfiguration.Cluster, ReadPreference.PrimaryPreferred))
            {
                var result = subject.Execute(binding, CancellationToken.None);

                result.Contains("inprog");
            }
        }
        public void Execute_should_return_expected_result()
        {
            var subject = new CurrentOpUsingFindOperation(_adminDatabaseNamespace, _messageEncoderSettings);

            using (var binding = new ReadPreferenceBinding(CoreTestConfiguration.Cluster, ReadPreference.PrimaryPreferred))
            {
                var result = subject.Execute(binding, CancellationToken.None);

                result.Contains("inprog");
            }
        }
        public void CreateOperation_should_return_expected_result()
        {
            var subject = new CurrentOpUsingFindOperation(_adminDatabaseNamespace, _messageEncoderSettings);

            var result = subject.CreateOperation();

            result.CollectionNamespace.Should().Be(new CollectionNamespace(_adminDatabaseNamespace, "$cmd.sys.inprog"));
            result.Limit.Should().Be(1);
            result.MessageEncoderSettings.Should().BeSameAs(_messageEncoderSettings);
            result.ResultSerializer.Should().BeSameAs(BsonDocumentSerializer.Instance);
        }
        public void Execute_should_return_expected_result()
        {
            RequireServer.Check().ClusterTypes(ClusterType.Standalone, ClusterType.ReplicaSet).StorageEngine("mmapv1");
            var subject = new CurrentOpUsingFindOperation(_adminDatabaseNamespace, _messageEncoderSettings);

            using (var binding = new ReadPreferenceBinding(CoreTestConfiguration.Cluster, ReadPreference.PrimaryPreferred))
            {
                var result = subject.Execute(binding, CancellationToken.None);

                result.Contains("inprog");
            }
        }