Ejemplo n.º 1
0
        public void ShouldGenerateCreateVertexQuery()
        {
            string generatedQuery = new OSqlCreateVertex()
                                    .Vertex("TestVertexClass")
                                    .ToString();

            string query =
                "CREATE VERTEX TestVertexClass";

            Assert.AreEqual(generatedQuery, query);
        }
        public void ShouldGenerateCreateVertexQuery()
        {
            string generatedQuery = new OSqlCreateVertex()
                .Vertex("TestVertexClass")
                .ToString();

            string query =
                "CREATE VERTEX TestVertexClass";

            Assert.AreEqual(generatedQuery, query);
        }
        public void ShouldGenerateCreateVertexClusterQuery()
        {
            string generatedQuery = new OSqlCreateVertex()
                                    .Vertex("TestVertexClass")
                                    .Cluster("TestCluster")
                                    .ToString();

            string query =
                "CREATE VERTEX TestVertexClass " +
                "CLUSTER TestCluster";

            Assert.Equal(generatedQuery, query);
        }
        public void ShouldGenerateCreateVertexClusterQuery()
        {
            string generatedQuery = new OSqlCreateVertex()
                .Vertex("TestVertexClass")
                .Cluster("TestCluster")
                .ToString();

            string query =
                "CREATE VERTEX TestVertexClass " +
                "CLUSTER TestCluster";

            Assert.Equal(generatedQuery, query);
        }
Ejemplo n.º 5
0
        public void ShouldGenerateCreateVertexClusterSetQuery()
        {
            string generatedQuery = new OSqlCreateVertex()
                                    .Vertex("TestVertexClass")
                                    .Cluster("TestCluster")
                                    .Set("foo", "foo string value")
                                    .Set("bar", 12345)
                                    .ToString();

            string query =
                "CREATE VERTEX TestVertexClass " +
                "CLUSTER TestCluster " +
                "SET foo = 'foo string value', " +
                "bar = 12345";

            Assert.AreEqual(generatedQuery, query);
        }
        public void ShouldGenerateCreateVertexClusterSetQuery()
        {
            string generatedQuery = new OSqlCreateVertex()
                .Vertex("TestVertexClass")
                .Cluster("TestCluster")
                .Set("foo", "foo string value")
                .Set("bar", 12345)
                .ToString();

            string query =
                "CREATE VERTEX TestVertexClass " +
                "CLUSTER TestCluster " +
                "SET foo = 'foo string value', " +
                "bar = 12345";

            Assert.AreEqual(generatedQuery, query);
        }
        public void ShouldGenerateCreateVertexFromObjectQuery()
        {
            TestProfileClass profile = new TestProfileClass();
            profile.Name = "Johny";
            profile.Surname = "Bravo";

            string generatedQuery = new OSqlCreateVertex()
                .Vertex(profile)
                .ToString();

            string query =
                "CREATE VERTEX TestProfileClass " +
                "SET Name = 'Johny', " +
                "Surname = 'Bravo'";

            Assert.AreEqual(generatedQuery, query);
        }
Ejemplo n.º 8
0
        public void ShouldGenerateCreateVertexFromObjectQuery()
        {
            TestProfileClass profile = new TestProfileClass();

            profile.Name    = "Johny";
            profile.Surname = "Bravo";

            string generatedQuery = new OSqlCreateVertex()
                                    .Vertex(profile)
                                    .ToString();

            string query =
                "CREATE VERTEX TestProfileClass " +
                "SET Name = 'Johny', " +
                "Surname = 'Bravo'";

            Assert.AreEqual(generatedQuery, query);
        }
        public void ShouldGenerateCreateVertexFromDocumentQuery()
        {
            ODocument document = new ODocument();
            document.OClassName = "TestVertexClass";
            document
                .SetField("foo", "foo string value")
                .SetField("bar", 12345);

            string generatedQuery = new OSqlCreateVertex()
                .Vertex(document)
                .ToString();

            string query =
                "CREATE VERTEX TestVertexClass " +
                "SET foo = 'foo string value', " +
                "bar = 12345";

            Assert.AreEqual(generatedQuery, query);
        }
Ejemplo n.º 10
0
        public void ShouldGenerateCreateVertexFromDocumentQuery()
        {
            ODocument document = new ODocument();

            document.OClassName = "TestVertexClass";
            document
            .SetField("foo", "foo string value")
            .SetField("bar", 12345);

            string generatedQuery = new OSqlCreateVertex()
                                    .Vertex(document)
                                    .ToString();

            string query =
                "CREATE VERTEX TestVertexClass " +
                "SET foo = 'foo string value', " +
                "bar = 12345";

            Assert.AreEqual(generatedQuery, query);
        }
        public void ShouldGenerateCreateVertexQuery()
        {
            string generatedUntypedQuery = new OSqlCreateVertex()
                .Vertex("TestVertexClass")
                .Cluster("OGraphVertex")
                .Set("Foo", "foo string value")
                .Also("Bar", 12345)
                .ToString();

            TestVertexClass testObj = new TestVertexClass();
            testObj.Foo = "foo string value";
            testObj.Bar = 12345;

            string generatedTypedQuery = new OSqlCreateVertex()
                .Vertex<TestVertexClass>()
                .Cluster<OGraphVertex>()
                .Set(testObj)
                .ToString();

            string query =
                "CREATE VERTEX TestVertexClass " +
                "CLUSTER OGraphVertex " +
                "SET Foo = 'foo string value', " +
                "Bar = 12345";

            Assert.AreEqual(generatedUntypedQuery, query);
            Assert.AreEqual(generatedTypedQuery, query);
        }