Пример #1
0
        // DIRECT ARRAYS

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldProvideDirectByteArrayAsPublic()
        internal virtual void ShouldProvideDirectByteArrayAsPublic()
        {
            sbyte[] inStore  = new sbyte[] { 1 };
            Value   value    = Values.ByteArray(inStore);
            object  asObject = value.AsObjectCopy();

            assertNotNull(asObject, "should return byte[]");

            sbyte[] arr = ( sbyte[] )asObject;
            assertTrue(Arrays.Equals(inStore, arr), "should have same values");

            arr[0] = -1;
            assertFalse(Arrays.Equals(inStore, arr), "should not modify inStore array");
            assertTrue(Arrays.Equals(inStore, ( sbyte[] )value.AsObjectCopy()), "should still generate inStore array");
        }