public void CreateCommand_should_return_expected_result_when_ValidationAction_is_set(
            [Values(DocumentValidationAction.Error, DocumentValidationAction.Warn)]
            DocumentValidationAction value)
        {
            var subject = new CreateCollectionOperation(_collectionNamespace, _messageEncoderSettings)
            {
                ValidationAction = value
            };
            var expectedResult = new BsonDocument
            {
                { "create", _collectionNamespace.CollectionName },
                { "validationAction", value.ToString().ToLowerInvariant() }
            };

            var result = subject.CreateCommand();

            result.Should().Be(expectedResult);
        }
 /// <summary>
 /// Sets the validation action.
 /// </summary>
 /// <param name="validationAction">The validation action.</param>
 /// <returns>The builder (so method calls can be chained).</returns>
 public CollectionOptionsBuilder SetValidationAction(DocumentValidationAction validationAction)
 {
     _document["validationAction"] = validationAction.ToString().ToLowerInvariant();
     return(this);
 }