public void Rollback_Marklogic_content_transaction_does_not_change_document()
        {
            var documentName = "test_02";
            var content      = "test_02_value";
            var doc          = MarklogicContent.Xml(documentName, GetTestDocument(documentName, content));

            var rest = new RestConnector(DbConnectionSettings);

            rest.Insert(doc);

            var transaction = rest.BeginTransaction();

            doc = MarklogicContent.Xml(documentName, GetTestDocument(documentName, $"{content}_changed"));
            rest.Insert(doc, transaction);
            rest.RollbackTransaction(transaction);

            var query    = $"xquery version '1.0-ml'; fn:doc('/{documentName}.xml')";
            var response = rest.Submit(query);
            var actual   = response.Content.ReadAsMultipartAsync().Result.Contents[0].ReadAsStringAsync().Result;
            var expected = MarklogicContent.Xml(documentName, GetTestDocumentXml(documentName, content)).Content;

            Assert.IsTrue(actual.Equals(expected));
        }
Пример #2
0
 public DatabaseTransaction(RestConnector restConnector)
 {
     _restConnector = restConnector;
     _transaction   = _restConnector.BeginTransaction();
 }