Arango.Tests.EdgeOperationsTests.Should_update_edge_with_waitForSync C# (CSharp) Method

Should_update_edge_with_waitForSync() private method

private Should_update_edge_with_waitForSync ( ) : void
return void
        public void Should_update_edge_with_waitForSync()
        {
            Database.ClearTestCollection(Database.TestEdgeCollectionName);
            var db = new ADatabase(Database.Alias);

            var document = new Dictionary<string, object>()
                .String("foo", "some string")
                .Int("bar", 12345);

            var createResult = db
                .Document
                .CreateEdge(Database.TestEdgeCollectionName, _documents[0].ID(), _documents[1].ID(), document);

            var newDocument = new Dictionary<string, object>()
                .String("foo", "some other new string")
                .Int("bar", 54321)
                .Int("baz", 12345);

            var updateResult = db
                .Document
                .WaitForSync(true)
                .Update(createResult.Value.ID(), newDocument);

            Assert.AreEqual(201, updateResult.StatusCode);
            Assert.IsTrue(updateResult.Success);
            Assert.IsTrue(updateResult.HasValue);
            Assert.AreEqual(updateResult.Value.ID(), createResult.Value.ID());
            Assert.AreEqual(updateResult.Value.Key(), createResult.Value.Key());
            Assert.AreNotEqual(updateResult.Value.Rev(), createResult.Value.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.AreNotEqual(getResult.Value.Int("bar"), document.Int("bar"));
            Assert.AreEqual(getResult.Value.Int("bar"), newDocument.Int("bar"));

            // by default JSON integers are deserialized to long type
            Assert.IsTrue(getResult.Value.IsLong("baz"));
        }
EdgeOperationsTests