Ejemplo n.º 1
0
        public void TestFloat()
        {
            const float a = 123.45f;
            GraphValue  b = a;

            var c = b.ToGraphString();

            Assert.Equal("123.45", c);

            GraphValue d = c;
            float      e = d;

            Assert.Equal(a, e);
        }
        IEdgeResult IEdgeResult.property(string key, GraphValue value)
        {
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            queryBuilder.Append($".property('{key}',{value.ToGraphString()})");
            return(this);
        }
Ejemplo n.º 3
0
        public void TestDecimal()
        {
            const decimal a = 123.456754567m;
            GraphValue    b = a;

            var c = b.ToGraphString();

            Assert.Equal("123.456754567", c);

            GraphValue d = c;
            decimal    e = d;

            Assert.Equal(a, e);
        }
Ejemplo n.º 4
0
        public void TestDouble()
        {
            const double a = 123.456754567;
            GraphValue   b = a;

            var c = b.ToGraphString();

            Assert.Equal("123.456754567", c);

            GraphValue d = c;
            double     e = d;

            Assert.Equal(a, e);
        }
Ejemplo n.º 5
0
        public void TestBoolean()
        {
            const bool a = true;
            GraphValue b = a;

            var c = b.ToGraphString();

            Assert.Equal("true", c);

            GraphValue d = c;
            bool       e = d;

            Assert.Equal(a, e);
        }
Ejemplo n.º 6
0
        public void TestDateTime()
        {
            var        a = DateTime.Parse("2017-10-06T11:59:51.4023776Z");
            GraphValue b = a;

            var c = b.ToGraphString();

            Assert.Equal("'2017-10-06T11:59:51.4023776Z'", c);

            GraphValue d = c;
            DateTime   e = d;

            Assert.Equal(a, e);
        }
Ejemplo n.º 7
0
        public void TestString()
        {
            const string a = "Seattle, WA";
            GraphValue   b = a;

            var c = b.ToGraphString();

            Assert.Equal("'Seattle, WA'", c);

            GraphValue d = c;
            string     e = d;

            Assert.Equal(a, e);
        }
Ejemplo n.º 8
0
        public void TestLong()
        {
            const long a = 123456789012345;
            GraphValue b = a;

            var c = b.ToGraphString();

            Assert.Equal("123456789012345", c);

            GraphValue d = c;
            long       e = d;

            Assert.Equal(a, e);
        }
Ejemplo n.º 9
0
        public void TestInt()
        {
            const int  a = 123;
            GraphValue b = a;

            var c = b.ToGraphString();

            Assert.Equal("123", c);

            GraphValue d = c;
            int        e = d;

            Assert.Equal(a, e);
        }
Ejemplo n.º 10
0
        public void TestGuid()
        {
            var        a = Guid.ParseExact("1a189755-8322-443e-8cca-a5c4c83d6207", "D");
            GraphValue b = a;

            var c = b.ToGraphString();

            Assert.Equal("'1a189755-8322-443e-8cca-a5c4c83d6207'", c);

            GraphValue d = c;
            Guid       e = d;

            Assert.Equal(a, e);
        }
Ejemplo n.º 11
0
        IVertexResult IVertexResult.has(string label, string key, GraphValue value)
        {
            if (label == null)
            {
                throw new ArgumentNullException(nameof(label));
            }
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            queryBuilder.Append($".has('{label}','{key}',{value.ToGraphString()})");

            return(this);
        }