예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldBeAbleToQuerySupportedPropertyTypes()
        public virtual void ShouldBeAbleToQuerySupportedPropertyTypes()
        {
            // GIVEN
            string property         = "name";
            GraphDatabaseService db = DbRule.GraphDatabaseAPI;

            Neo4jMatchers.createIndex(db, _label1, property);

            // WHEN & THEN
            AssertCanCreateAndFind(db, _label1, property, "A String");
            AssertCanCreateAndFind(db, _label1, property, true);
            AssertCanCreateAndFind(db, _label1, property, false);
            AssertCanCreateAndFind(db, _label1, property, ( sbyte )56);
            AssertCanCreateAndFind(db, _label1, property, 'z');
            AssertCanCreateAndFind(db, _label1, property, ( short )12);
            AssertCanCreateAndFind(db, _label1, property, 12);
            AssertCanCreateAndFind(db, _label1, property, 12L);
            AssertCanCreateAndFind(db, _label1, property, ( float )12.0);
            AssertCanCreateAndFind(db, _label1, property, 12.0);
            AssertCanCreateAndFind(db, _label1, property, SpatialMocks.mockPoint(12.3, 45.6, mockWGS84()));
            AssertCanCreateAndFind(db, _label1, property, SpatialMocks.mockPoint(123, 456, mockCartesian()));
            AssertCanCreateAndFind(db, _label1, property, SpatialMocks.mockPoint(12.3, 45.6, 100.0, mockWGS84_3D()));
            AssertCanCreateAndFind(db, _label1, property, SpatialMocks.mockPoint(123, 456, 789, mockCartesian_3D()));
            AssertCanCreateAndFind(db, _label1, property, Values.pointValue(CoordinateReferenceSystem.WGS84, 12.3, 45.6));
            AssertCanCreateAndFind(db, _label1, property, Values.pointValue(CoordinateReferenceSystem.Cartesian, 123, 456));
            AssertCanCreateAndFind(db, _label1, property, Values.pointValue(CoordinateReferenceSystem.WGS84_3D, 12.3, 45.6, 100.0));
            AssertCanCreateAndFind(db, _label1, property, Values.pointValue(CoordinateReferenceSystem.Cartesian_3D, 123, 456, 789));

            AssertCanCreateAndFind(db, _label1, property, new string[] { "A String" });
            AssertCanCreateAndFind(db, _label1, property, new bool[] { true });
            AssertCanCreateAndFind(db, _label1, property, new bool?[] { false });
            AssertCanCreateAndFind(db, _label1, property, new sbyte[] { 56 });
            AssertCanCreateAndFind(db, _label1, property, new sbyte?[] { 57 });
            AssertCanCreateAndFind(db, _label1, property, new char[] { 'a' });
            AssertCanCreateAndFind(db, _label1, property, new char?[] { 'b' });
            AssertCanCreateAndFind(db, _label1, property, new short[] { 12 });
            AssertCanCreateAndFind(db, _label1, property, new short?[] { 13 });
            AssertCanCreateAndFind(db, _label1, property, new int[] { 14 });
            AssertCanCreateAndFind(db, _label1, property, new int?[] { 15 });
            AssertCanCreateAndFind(db, _label1, property, new long[] { 16L });
            AssertCanCreateAndFind(db, _label1, property, new long?[] { 17L });
            AssertCanCreateAndFind(db, _label1, property, new float[] { ( float )18.0 });
            AssertCanCreateAndFind(db, _label1, property, new float?[] { ( float )19.0 });
            AssertCanCreateAndFind(db, _label1, property, new double[] { 20.0 });
            AssertCanCreateAndFind(db, _label1, property, new double?[] { 21.0 });
            AssertCanCreateAndFind(db, _label1, property, new Point[] { SpatialMocks.mockPoint(12.3, 45.6, mockWGS84()) });
            AssertCanCreateAndFind(db, _label1, property, new Point[] { SpatialMocks.mockPoint(123, 456, mockCartesian()) });
            AssertCanCreateAndFind(db, _label1, property, new Point[] { SpatialMocks.mockPoint(12.3, 45.6, 100.0, mockWGS84_3D()) });
            AssertCanCreateAndFind(db, _label1, property, new Point[] { SpatialMocks.mockPoint(123, 456, 789, mockCartesian_3D()) });
            AssertCanCreateAndFind(db, _label1, property, new PointValue[] { Values.pointValue(CoordinateReferenceSystem.WGS84, 12.3, 45.6) });
            AssertCanCreateAndFind(db, _label1, property, new PointValue[] { Values.pointValue(CoordinateReferenceSystem.Cartesian, 123, 456) });
            AssertCanCreateAndFind(db, _label1, property, new PointValue[] { Values.pointValue(CoordinateReferenceSystem.WGS84_3D, 12.3, 45.6, 100.0) });
            AssertCanCreateAndFind(db, _label1, property, new PointValue[] { Values.pointValue(CoordinateReferenceSystem.Cartesian_3D, 123, 456, 789) });
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCartesian3DPointWriting() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestCartesian3DPointWriting()
        {
            //Given
            Point value = SpatialMocks.mockPoint(123.0, 456.0, 789.0, mockCartesian_3D());

            //When
            _jsonCodec.writeValue(_jsonGenerator, value);

            //Then
            verify(_jsonGenerator, times(3)).writeEndObject();
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testGeographic3DPointWriting() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestGeographic3DPointWriting()
        {
            //Given
            Point value = SpatialMocks.mockPoint(12.3, 45.6, 78.9, mockWGS84_3D());

            //When
            _jsonCodec.writeValue(_jsonGenerator, value);

            //Then
            verify(_jsonGenerator, times(3)).writeEndObject();
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testGeometryWriting() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestGeometryWriting()
        {
            //Given
            IList <Coordinate> points = new List <Coordinate>();

            points.Add(new Coordinate(1, 2));
            points.Add(new Coordinate(2, 3));
            Geometry value = SpatialMocks.mockGeometry("LineString", points, mockCartesian());

            //When
            _jsonCodec.writeValue(_jsonGenerator, value);

            //Then
            verify(_jsonGenerator, times(3)).writeEndObject();
        }