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

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

            result.DatabaseNamespace.Should().Be(_adminDatabaseNamespace);
            result.MessageEncoderSettings.Should().BeEquivalentTo(_messageEncoderSettings);
        }
        public void Execute_should_return_expected_result()
        {
            var subject = new CurrentOpUsingCommandOperation(_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 CurrentOpUsingCommandOperation(_adminDatabaseNamespace, _messageEncoderSettings);

            var result = subject.CreateOperation();

            result.Command.Should().Be("{ currentOp : 1 }");
            result.DatabaseNamespace.Should().BeSameAs(_adminDatabaseNamespace);
            result.MessageEncoderSettings.Should().BeSameAs(_messageEncoderSettings);
            result.ResultSerializer.Should().BeSameAs(BsonDocumentSerializer.Instance);
        }
        public void CreateOperation_should_return_expected_result()
        {
            var subject = new CurrentOpUsingCommandOperation(_adminDatabaseNamespace, _messageEncoderSettings);

            var result = subject.CreateOperation();

            result.Command.Should().Be("{ currentOp : 1 }");
            result.DatabaseNamespace.Should().BeSameAs(_adminDatabaseNamespace);
            result.MessageEncoderSettings.Should().BeSameAs(_messageEncoderSettings);
            result.ResultSerializer.Should().BeSameAs(BsonDocumentSerializer.Instance);
        }
Пример #6
0
        public void Execute_should_return_expected_result()
        {
            var subject = new CurrentOpUsingCommandOperation(_adminDatabaseNamespace, _messageEncoderSettings);

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

                result.Contains("inprog");
            }
        }
Пример #7
0
        public void Execute_should_return_expected_result()
        {
            RequireServer.Check().Supports(Feature.CurrentOpCommand);
            var subject = new CurrentOpUsingCommandOperation(_adminDatabaseNamespace, _messageEncoderSettings);

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

                result.Contains("inprog");
            }
        }