//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldConvertStringValueToString()
        internal virtual void ShouldConvertStringValueToString()
        {
            PrimitiveOnlyValueWriter writer = new PrimitiveOnlyValueWriter();
            TextValue value = stringValue("Hello");

            assertEquals("Hello", writer.ValueAsObject(value));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldConvertLongValueToLong()
        internal virtual void ShouldConvertLongValueToLong()
        {
            PrimitiveOnlyValueWriter writer = new PrimitiveOnlyValueWriter();
            LongValue value = longValue(42);

            assertEquals(42L, writer.ValueAsObject(value));
        }
예제 #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public static java.util.Map<String,Object> readMetaDataMap(org.neo4j.bolt.messaging.Neo4jPack_Unpacker unpacker) throws java.io.IOException
        public static IDictionary <string, object> ReadMetaDataMap(Org.Neo4j.Bolt.messaging.Neo4jPack_Unpacker unpacker)
        {
            MapValue metaDataMapValue                = unpacker.UnpackMap();
            PrimitiveOnlyValueWriter     writer      = new PrimitiveOnlyValueWriter();
            IDictionary <string, object> metaDataMap = new Dictionary <string, object>(metaDataMapValue.Size());

            metaDataMapValue.Foreach((key, value) =>
            {
                object convertedValue = AuthToken.containsSensitiveInformation(key) ? writer.SensitiveValueAsObject(value) : writer.ValueAsObject(value);
                metaDataMap[key]      = convertedValue;
            });
            return(metaDataMap);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldConvertMultipleValues()
        internal virtual void ShouldConvertMultipleValues()
        {
            PrimitiveOnlyValueWriter writer = new PrimitiveOnlyValueWriter();

            TextValue value1 = stringValue("Hello");
            TextValue value2 = stringValue(" ");
            TextValue value3 = stringValue("World!");
            LongValue value4 = longValue(42);

            assertEquals("Hello", writer.ValueAsObject(value1));
            assertEquals(" ", writer.ValueAsObject(value2));
            assertEquals("World!", writer.ValueAsObject(value3));
            assertEquals(42L, writer.ValueAsObject(value4));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @MethodSource("unsupportedValues") void shouldFailToWriteComplexValue(org.neo4j.values.AnyValue value)
        internal virtual void ShouldFailToWriteComplexValue(AnyValue value)
        {
            PrimitiveOnlyValueWriter writer = new PrimitiveOnlyValueWriter();

            assertThrows(typeof(System.NotSupportedException), () => writer.ValueAsObject(value));
        }