Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGetAllNodeProperties()
        public virtual void ShouldGetAllNodeProperties()
        {
            // GIVEN
            string longString = "AlalalalalongAlalalalalongAlalalalalongAlalalalalongAlalalalalongAlalalalalongAlalalalalongAlalalalalong";

            object[] properties = new object[] { longString, CreateNew(typeof(string)), CreateNew(typeof(long)), CreateNew(typeof(int)), CreateNew(typeof(sbyte)), CreateNew(typeof(short)), CreateNew(typeof(bool)), CreateNew(typeof(char)), CreateNew(typeof(float)), CreateNew(typeof(double)), Array(0, typeof(string)), Array(0, typeof(long)), Array(0, typeof(int)), Array(0, typeof(sbyte)), Array(0, typeof(short)), Array(0, typeof(bool)), Array(0, typeof(char)), Array(0, typeof(float)), Array(0, typeof(double)), Array(1, typeof(string)), Array(1, typeof(long)), Array(1, typeof(int)), Array(1, typeof(sbyte)), Array(1, typeof(short)), Array(1, typeof(bool)), Array(1, typeof(char)), Array(1, typeof(float)), Array(1, typeof(double)), Array(256, typeof(string)), Array(256, typeof(long)), Array(256, typeof(int)), Array(256, typeof(sbyte)), Array(256, typeof(short)), Array(256, typeof(bool)), Array(256, typeof(char)), Array(256, typeof(float)), Array(256, typeof(double)) };

            foreach (object value in properties)
            {
                // given
                long nodeId = CreateLabeledNode(Db, singletonMap("prop", value), Label1).Id;

                // when
                using (StorageNodeCursor node = StorageReader.allocateNodeCursor())
                {
                    node.Single(nodeId);
                    assertTrue(node.Next());

                    using (StoragePropertyCursor props = StorageReader.allocatePropertyCursor())
                    {
                        props.Init(node.PropertiesReference());
                        if (props.Next())
                        {
                            Value propVal = props.PropertyValue();

                            //then
                            assertTrue(propVal + ".equals(" + value + ")", propVal.Equals(Values.of(value)));
                        }
                        else
                        {
                            fail();
                        }
                    }
                }
            }
        }