示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Disabled("Comparing strings with higher than 16 bits code points is known to be inconsistent between StringValue and UTF8StringValue") @Test void shouldCompareToRandomString()
        internal virtual void ShouldCompareToRandomString()
        {
            for (int i = 0; i < 100; i++)
            {
                string string1 = Random.nextString();
                string string2 = Random.nextString();
                UTF8StringValueTest.AssertCompareTo(string1, string2);
            }
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void minimalSplitterShouldRemoveEntityIdIfPossible()
        internal virtual void MinimalSplitterShouldRemoveEntityIdIfPossible()
        {
            // Given
            StringLayout   layout          = new StringLayout();
            StringIndexKey left            = layout.NewKey();
            StringIndexKey right           = layout.NewKey();
            StringIndexKey minimalSplitter = layout.NewKey();

            string    @string    = _random.nextString();
            TextValue leftValue  = Values.stringValue(@string);
            TextValue rightValue = Values.stringValue(@string + _random.randomValues().nextCharRaw());

            // keys with unique values
            left.Initialize(1);
            left.initFromValue(0, leftValue, NEUTRAL);
            right.Initialize(2);
            right.initFromValue(0, rightValue, NEUTRAL);

            // When creating minimal splitter
            layout.MinimalSplitter(left, right, minimalSplitter);

            // Then that minimal splitter should have entity id shaved off
            assertEquals(NO_ENTITY_ID, minimalSplitter.EntityId, "Expected minimal splitter to have entityId removed when constructed from keys with unique values: " + "left=" + leftValue + ", right=" + rightValue);
        }