Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldIncludeLabel()
        public virtual void ShouldIncludeLabel()
        {
            // GIVEN
            string          labelName   = "person";
            string          propertyKey = "name";
            IndexDefinition definition  = mock(typeof(IndexDefinition));

            when(definition.NodeIndex).thenReturn(true);
            when(definition.Labels).thenReturn(singletonList(label(labelName)));
            when(definition.PropertyKeys).thenReturn(singletonList(propertyKey));
            IndexDefinitionRepresentation representation = new IndexDefinitionRepresentation(definition);
            IDictionary <string, object>  serialized     = RepresentationTestAccess.Serialize(representation);

            // THEN
            assertEquals(singletonList(propertyKey), serialized["property_keys"]);
            assertEquals(labelName, serialized["label"]);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCreateAMapContainingDataAndManagementURIs() throws java.net.URISyntaxException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldCreateAMapContainingDataAndManagementURIs()
        {
            string managementUri       = "/management";
            string dataUri             = "/data";
            DiscoveryRepresentation dr = new DiscoveryRepresentation(new DiscoverableURIs.Builder()
                                                                     .add("management", managementUri, NORMAL).add("data", dataUri, NORMAL).add("bolt", new URI("bolt://localhost:7687"), NORMAL).build());

            IDictionary <string, object> mapOfUris = RepresentationTestAccess.Serialize(dr);

            object mappedManagementUri = mapOfUris["management"];
            object mappedDataUri       = mapOfUris["data"];
            object mappedBoltUri       = mapOfUris["bolt"];

            assertNotNull(mappedManagementUri);
            assertNotNull(mappedDataUri);
            assertNotNull(mappedBoltUri);

            URI baseUri = RepresentationTestBase.BaseUri;

            assertEquals(mappedManagementUri.ToString(), Serializer.JoinBaseWithRelativePath(baseUri, managementUri));
            assertEquals(mappedDataUri.ToString(), Serializer.JoinBaseWithRelativePath(baseUri, dataUri));
            assertEquals(mappedBoltUri.ToString(), "bolt://localhost:7687");
        }