コード例 #1
0
        public void constructor_should_initialize_instance_when_messageEncoderSettings_is_null()
        {
            var databaseNamespace = new DatabaseNamespace("databaseName");
            var command           = new BsonDocument("command", 1);
            var resultSerializer  = new BsonDocumentSerializer();
            MessageEncoderSettings messageEncoderSettings = null;

            var result = new FakeCommandOperation <BsonDocument>(databaseNamespace, command, resultSerializer, messageEncoderSettings);

            result.MessageEncoderSettings.Should().BeNull();
        }
コード例 #2
0
        public void constructor_should_initialize_instance()
        {
            var databaseNamespace      = new DatabaseNamespace("databaseName");
            var command                = new BsonDocument("command", 1);
            var resultSerializer       = new BsonDocumentSerializer();
            var messageEncoderSettings = new MessageEncoderSettings();

            var result = new FakeCommandOperation <BsonDocument>(databaseNamespace, command, resultSerializer, messageEncoderSettings);

            result.AdditionalOptions.Should().BeNull();
            result.Command.Should().BeSameAs(command);
            result.CommandValidator.Should().BeOfType <NoOpElementNameValidator>();
            result.Comment.Should().BeNull();
            result.DatabaseNamespace.Should().BeSameAs(databaseNamespace);
            result.ResultSerializer.Should().BeSameAs(resultSerializer);
            result.MessageEncoderSettings.Should().BeSameAs(messageEncoderSettings);
        }