示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldProvideDirectCharArrayAsPublic()
        internal virtual void ShouldProvideDirectCharArrayAsPublic()
        {
            char[] inStore  = new char[] { 'a' };
            Value  value    = Values.CharArray(inStore);
            object asObject = value.AsObjectCopy();

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

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

            arr[0] = 'b';
            assertFalse(Arrays.Equals(inStore, arr), "should not modify inStore array");
            assertTrue(Arrays.Equals(inStore, ( char[] )value.AsObjectCopy()), "should still generate inStore array");
        }
示例#2
0
        public override ListValue Split(string separator)
        {
            Debug.Assert(!string.ReferenceEquals(separator, null));
            string asString = Value();

            //Cypher has different semantics for the case where the separator
            //is exactly the value, in cypher we expect two empty arrays
            //where as java returns an empty array
            if (separator.Equals(asString))
            {
                return(EmptySplit);
            }
            else if (separator.Length == 0)
            {
                return(VirtualValues.fromArray(Values.CharArray(asString.ToCharArray())));
            }

            IList <AnyValue> split = SplitNonRegex(asString, separator);

            return(VirtualValues.fromList(split));
        }
示例#3
0
 public static Test ShouldNotMatch(char[] propertyValue, object value)
 {
     return(new Test(Values.CharArray(propertyValue), value, false));
 }
示例#4
0
 private static Test ShouldMatch(char[] propertyValue, object value)
 {
     return(new Test(Values.CharArray(propertyValue), value, true));
 }