Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleArrays()
        internal virtual void ShouldHandleArrays()
        {
            // Given
            PrettyPrinter printer = new PrettyPrinter();
            TextArray     array   = Values.stringArray("a", "b", "c");

            // When
            array.WriteTo(printer);

            // Then
            assertThat(printer.Value(), equalTo("[\"a\", \"b\", \"c\"]"));
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleNodeValue()
        internal virtual void ShouldHandleNodeValue()
        {
            // Given
            NodeValue     node    = VirtualValues.nodeValue(42L, Values.stringArray("L1", "L2", "L3"), Props("foo", intValue(42), "bar", list(intValue(1337), stringValue("baz"))));
            PrettyPrinter printer = new PrettyPrinter();

            // When
            node.WriteTo(printer);

            // Then
            assertThat(printer.Value(), equalTo("(id=42 :L1:L2:L3 {bar: [1337, \"baz\"], foo: 42})"));
        }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleEdgeValueWithoutLabelsNorProperties()
        internal virtual void ShouldHandleEdgeValueWithoutLabelsNorProperties()
        {
            // Given
            NodeValue     node    = VirtualValues.nodeValue(42L, Values.stringArray(), EMPTY_MAP);
            PrettyPrinter printer = new PrettyPrinter();

            // When
            node.WriteTo(printer);

            // Then
            assertThat(printer.Value(), equalTo("(id=42)"));
        }
Пример #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleNodeValueWithoutProperties()
        internal virtual void ShouldHandleNodeValueWithoutProperties()
        {
            // Given
            NodeValue     node    = VirtualValues.nodeValue(42L, Values.stringArray("L1", "L2", "L3"), EMPTY_MAP);
            PrettyPrinter printer = new PrettyPrinter();

            // When
            node.WriteTo(printer);

            // Then
            assertThat(printer.Value(), equalTo("(id=42 :L1:L2:L3)"));
        }
Пример #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleEdgeValueWithoutProperties()
        internal virtual void ShouldHandleEdgeValueWithoutProperties()
        {
            NodeValue         startNode = VirtualValues.nodeValue(1L, Values.stringArray("L"), EMPTY_MAP);
            NodeValue         endNode   = VirtualValues.nodeValue(2L, Values.stringArray("L"), EMPTY_MAP);
            RelationshipValue rel       = VirtualValues.relationshipValue(42L, startNode, endNode, stringValue("R"), EMPTY_MAP);
            PrettyPrinter     printer   = new PrettyPrinter();

            // When
            rel.WriteTo(printer);

            // Then
            assertThat(printer.Value(), equalTo("-[id=42 :R]-"));
        }
Пример #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleEdgeValue()
        internal virtual void ShouldHandleEdgeValue()
        {
            // Given
            NodeValue         startNode = VirtualValues.nodeValue(1L, Values.stringArray("L"), EMPTY_MAP);
            NodeValue         endNode   = VirtualValues.nodeValue(2L, Values.stringArray("L"), EMPTY_MAP);
            RelationshipValue rel       = VirtualValues.relationshipValue(42L, startNode, endNode, stringValue("R"), Props("foo", intValue(42), "bar", list(intValue(1337), stringValue("baz"))));
            PrettyPrinter     printer   = new PrettyPrinter();

            // When
            rel.WriteTo(printer);

            // Then
            assertThat(printer.Value(), equalTo("-[id=42 :R {bar: [1337, \"baz\"], foo: 42}]-"));
        }
Пример #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandlePaths()
        internal virtual void ShouldHandlePaths()
        {
            // Given
            NodeValue         startNode = VirtualValues.nodeValue(1L, Values.stringArray("L"), EMPTY_MAP);
            NodeValue         endNode   = VirtualValues.nodeValue(2L, Values.stringArray("L"), EMPTY_MAP);
            RelationshipValue rel       = VirtualValues.relationshipValue(42L, startNode, endNode, stringValue("R"), EMPTY_MAP);
            PathValue         path      = VirtualValues.path(new NodeValue[] { startNode, endNode }, new RelationshipValue[] { rel });
            PrettyPrinter     printer   = new PrettyPrinter();

            // When
            path.WriteTo(printer);

            // Then
            assertThat(printer.Value(), equalTo("(id=1 :L)-[id=42 :R]->(id=2 :L)"));
        }
Пример #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldNotEqual()
        internal virtual void ShouldNotEqual()
        {
            assertNotEqual(list(), list(2));
            assertNotEqual(list(), list(1, 2));
            assertNotEqual(list(1), list(2));
            assertNotEqual(list(1), list(1, 2));
            assertNotEqual(list(1, 1), list(1, 2));
            assertNotEqual(list(1, "d"), list(1, "f"));
            assertNotEqual(list(1, "d"), list("d", 1));
            assertNotEqual(list("d"), list(false));
            assertNotEqual(list(Values.stringArray("d")), list("d"));

            assertNotEqual(list(longArray(new long[] { 3, 4, 5 })), list(intArray(new int[] { 3, 4, 50 })));

            // different value types
            assertNotEqual(list(true, true), intArray(new int[] { 0, 0 }));
            assertNotEqual(list(true, true), longArray(new long[] { 0L, 0L }));
            assertNotEqual(list(true, true), shortArray(new short[] { ( short )0, ( short )0 }));
            assertNotEqual(list(true, true), floatArray(new float[] { 0.0f, 0.0f }));
            assertNotEqual(list(true, true), doubleArray(new double[] { 0.0, 0.0 }));
            assertNotEqual(list(true, true), charArray(new char[] { 'T', 'T' }));
            assertNotEqual(list(true, true), stringArray("True", "True"));
            assertNotEqual(list(true, true), byteArray(new sbyte[] { ( sbyte )0, ( sbyte )0 }));

            // wrong or missing items
            assertNotEqual(list(true), booleanArray(new bool[] { true, false }));
            assertNotEqual(list(true, true), booleanArray(new bool[] { true, false }));
            assertNotEqual(list(84, 104, 32, 105, 115, 32, 106, 117, 115, 116, 32, 97, 32, 116, 101, 115, 116), byteArray("This is just a test".GetBytes()));
            assertNotEqual(list('h'), charArray(new char[] { 'h', 'i' }));
            assertNotEqual(list('h', 'o'), charArray(new char[] { 'h', 'i' }));
            assertNotEqual(list(9.0, 2.0), doubleArray(new double[] { 1.0, 2.0 }));
            assertNotEqual(list(1.0), doubleArray(new double[] { 1.0, 2.0 }));
            assertNotEqual(list(1.5f), floatArray(new float[] { 1.5f, -5f }));
            assertNotEqual(list(1.5f, 5f), floatArray(new float[] { 1.5f, -5f }));
            assertNotEqual(list(1, 3), intArray(new int[] { 1, -3 }));
            assertNotEqual(list(-3), intArray(new int[] { 1, -3 }));
            assertNotEqual(list(2L, 3L), longArray(new long[] { 2L, -3L }));
            assertNotEqual(list(2L), longArray(new long[] { 2L, -3L }));
            assertNotEqual(list(( short )2, ( short )3), shortArray(new short[] { ( short )2, ( short )-3 }));
            assertNotEqual(list(( short )2), shortArray(new short[] { ( short )2, ( short )-3 }));
            assertNotEqual(list("hi", "hello"), stringArray("hi"));
            assertNotEqual(list("hello"), stringArray("hi"));

            assertNotEqual(list(1, 'b'), charArray(new char[] { 'a', 'b' }));
        }