Пример #1
0
        public void Simple_edge_delete_should_work()
        {
            using (var storage = new GraphStorage())
            {
                long vertexId1, vertexId2, edgeId;
                using (var tx = storage.WriteTransaction())
                {
                    vertexId1 = storage.AddVertex(tx, new byte[] { 1, 2, 3 });
                    vertexId2 = storage.AddVertex(tx, new byte[] { 3, 2, 1 });

                    edgeId = storage.AddEdge(tx, vertexId1, vertexId2, new byte[] { 5, 6, 7, 8 });

                    tx.Commit();
                }

                using (var tx = storage.ReadTransaction())
                {
                    var data = storage.ReadEdgeData(tx, edgeId);
                    Assert.NotNull(data);
                }

                using (var tx = storage.WriteTransaction())
                {
                    storage.RemoveEdge(tx, edgeId);
                    tx.Commit();
                }

                using (var tx = storage.ReadTransaction())
                {
                    var data = storage.ReadEdgeData(tx, edgeId);
                    Assert.Null(data);
                }
            }
        }