public void Should_update_edge_with_mergeArrays_set_to_true()
{
Database.ClearTestCollection(Database.TestEdgeCollectionName);
var db = new ADatabase(Database.Alias);
var document = new Dictionary<string, object>()
.String("foo", "some string")
.Document("bar", new Dictionary<string, object>().String("foo", "string value"));
var createResult = db
.Document
.CreateEdge(Database.TestEdgeCollectionName, _documents[0].ID(), _documents[1].ID(), document);
document.Merge(createResult.Value);
var newDocument = new Dictionary<string, object>()
.String("foo", "some other new string")
.Document("bar", new Dictionary<string, object>().String("bar", "other string value"));
var updateResult = db
.Document
.MergeObjects(true) // this is also default behavior
.Update(createResult.Value.ID(), newDocument);
Assert.AreEqual(202, updateResult.StatusCode);
Assert.IsTrue(updateResult.Success);
Assert.IsTrue(updateResult.HasValue);
Assert.AreEqual(updateResult.Value.ID(), document.ID());
Assert.AreEqual(updateResult.Value.Key(), document.Key());
Assert.AreNotEqual(updateResult.Value.Rev(), document.Rev());
var getResult = db
.Document
.Get(updateResult.Value.ID());
Assert.AreEqual(getResult.Value.ID(), updateResult.Value.ID());
Assert.AreEqual(getResult.Value.Key(), updateResult.Value.Key());
Assert.AreEqual(getResult.Value.Rev(), updateResult.Value.Rev());
Assert.AreNotEqual(getResult.Value.String("foo"), document.String("foo"));
Assert.AreEqual(getResult.Value.String("foo"), newDocument.String("foo"));
Assert.IsTrue(getResult.Value.Has("bar.foo"));
Assert.IsTrue(getResult.Value.Has("bar.bar"));
}