Example #1
0
        public static void VerifyMetaProperties(ISession session, GraphTraversalSource g, Guid pk, MetaProp metaProp)
        {
            var stmt    = DseGraph.StatementFromTraversal(g.V().HasLabel("meta_v"));
            var walkers = session.ExecuteGraph(stmt);
            var result  = walkers.FirstOrDefault();

            Assert.IsNotNull(result);
            var nightKing = result.ToVertex();

            TestHelper.FillVertexProperties(session, nightKing);
            Assert.AreEqual("meta_v", nightKing.Label);
            var dbPk       = nightKing.GetProperty("pk").Value.To <Guid>();
            var dbMetaProp = nightKing.GetProperty("meta_prop").Value.To <MetaProp>();

            Assert.AreEqual(pk, dbPk);
            Assert.AreEqual(metaProp.SubProp, dbMetaProp.SubProp);
            Assert.AreEqual(metaProp.SubProp2, dbMetaProp.SubProp2);

            var dbMetaPropDict = nightKing.GetProperty("meta_prop").Value.To <IDictionary <string, string> >();

            Assert.AreEqual(metaProp.SubProp, dbMetaPropDict["sub_prop"]);
            Assert.AreEqual(metaProp.SubProp2, dbMetaPropDict["sub_prop2"]);
        }