Esempio n. 1
0
 private void AssertListValuesEquals(ListValue appended, ListValue expected)
 {
     assertEquals(expected, appended);
     assertEquals(expected.GetHashCode(), appended.GetHashCode());
     assertArrayEquals(expected.AsArray(), appended.AsArray());
     assertTrue(iteratorsEqual(expected.GetEnumerator(), appended.GetEnumerator()));
 }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleNegativeStep()
        internal virtual void ShouldHandleNegativeStep()
        {
            ListValue range = range(11L, 5L, -3L);

            ListValue expected = list(longValue(11L), longValue(8L), longValue(5L));

            assertEquals(range, expected);
            assertEquals(range.GetHashCode(), expected.GetHashCode());
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleRangeWithBiggerSteps()
        internal virtual void ShouldHandleRangeWithBiggerSteps()
        {
            ListValue range = range(5L, 11L, 3L);

            ListValue expected = list(longValue(5L), longValue(8L), longValue(11L));

            assertEquals(range, expected);
            assertEquals(range.GetHashCode(), expected.GetHashCode());
        }
Esempio n. 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleEmptyList()
        internal virtual void ShouldHandleEmptyList()
        {
            // Given
            ListValue inner = EMPTY_LIST;
            // When
            ListValue reverse = inner.Reverse();

            // Then
            assertEquals(inner, reverse);
            assertEquals(inner.GetHashCode(), reverse.GetHashCode());
            assertArrayEquals(inner.AsArray(), reverse.AsArray());
        }
Esempio n. 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleSingleListConcatenation()
        internal virtual void ShouldHandleSingleListConcatenation()
        {
            // Given
            ListValue inner = list(stringValue("foo"), longValue(42), booleanValue(true));

            // When
            ListValue concat = concat(inner);

            // Then
            assertEquals(inner, concat);
            assertEquals(inner.GetHashCode(), concat.GetHashCode());
            assertArrayEquals(inner.AsArray(), concat.AsArray());
        }
Esempio n. 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleSingleItemList()
        internal virtual void ShouldHandleSingleItemList()
        {
            // Given
            ListValue inner = list(longValue(5L));

            // When
            ListValue reverse = inner.Reverse();

            // Then
            assertEquals(inner, reverse);
            assertEquals(inner.GetHashCode(), reverse.GetHashCode());
            assertArrayEquals(inner.AsArray(), reverse.AsArray());
        }
Esempio n. 7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleNegativeStart()
        internal virtual void ShouldHandleNegativeStart()
        {
            // Given
            ListValue inner = list(longValue(5L), longValue(6L), longValue(7L), longValue(8L), longValue(9L), longValue(10L), longValue(11L));

            // When
            ListValue slice = inner.Slice(-2, 400000);

            // Then
            assertEquals(inner, slice);
            assertEquals(inner.GetHashCode(), slice.GetHashCode());
            assertArrayEquals(inner.AsArray(), slice.AsArray());
            assertTrue(iteratorsEqual(inner.GetEnumerator(), slice.GetEnumerator()));
        }
Esempio n. 8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldReverseList()
        internal virtual void ShouldReverseList()
        {
            // Given
            ListValue inner = list(longValue(5L), longValue(6L), longValue(7L));

            // When
            ListValue reverse = inner.Reverse();

            // Then
            ListValue expected = list(longValue(7L), longValue(6L), longValue(5L));

            assertEquals(expected, reverse);
            assertEquals(expected.GetHashCode(), reverse.GetHashCode());
            assertArrayEquals(expected.AsArray(), reverse.AsArray());
        }
Esempio n. 9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldFilterList()
        internal virtual void ShouldFilterList()
        {
            // Given
            ListValue inner = list(NO_VALUE, longValue(6L), NO_VALUE, longValue(8L), longValue(9L), longValue(11L), NO_VALUE);

            // When
            ListValue filter = inner.DropNoValues();

            // Then
            ListValue expected = list(longValue(6L), longValue(8L), longValue(9L), longValue(11L));

            assertEquals(filter, expected);
            assertEquals(filter.GetHashCode(), expected.GetHashCode());
            assertArrayEquals(filter.AsArray(), expected.AsArray());
        }
Esempio n. 10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleExceedingRange()
        internal virtual void ShouldHandleExceedingRange()
        {
            // Given
            ListValue inner = list(longValue(5L), longValue(6L), longValue(7L), longValue(8L), longValue(9L), longValue(10L), longValue(11L));

            // When
            ListValue slice = inner.Slice(2, 400000);

            // Then
            ListValue expected = list(longValue(7L), longValue(8L), longValue(9L), longValue(10L), longValue(11L));

            assertEquals(expected, slice);
            assertEquals(expected.GetHashCode(), slice.GetHashCode());
            assertArrayEquals(expected.AsArray(), slice.AsArray());
            assertTrue(iteratorsEqual(expected.GetEnumerator(), slice.GetEnumerator()));
        }
Esempio n. 11
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldBeAbleToTakeFromList()
        internal virtual void ShouldBeAbleToTakeFromList()
        {
            // Given
            ListValue inner = list(longValue(5L), longValue(6L), longValue(7L), longValue(8L), longValue(9L), longValue(10L), longValue(11L));

            // When
            ListValue take = inner.Take(3);

            // Then
            ListValue expected = list(longValue(5L), longValue(6L), longValue(7L));

            assertEquals(expected, take);
            assertEquals(expected.GetHashCode(), take.GetHashCode());
            assertArrayEquals(expected.AsArray(), take.AsArray());
            assertTrue(iteratorsEqual(expected.GetEnumerator(), take.GetEnumerator()));
        }
Esempio n. 12
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldBeAbleToDropFromList()
        internal virtual void ShouldBeAbleToDropFromList()
        {
            // Given
            ListValue inner = list(longValue(5L), longValue(6L), longValue(7L), longValue(8L), longValue(9L), longValue(10L), longValue(11L));

            // When
            ListValue drop = inner.Drop(4);

            // Then
            ListValue expected = list(longValue(9L), longValue(10L), longValue(11L));

            assertEquals(expected, drop);
            assertEquals(expected.GetHashCode(), drop.GetHashCode());
            assertArrayEquals(expected.AsArray(), drop.AsArray());
            assertTrue(iteratorsEqual(expected.GetEnumerator(), drop.GetEnumerator()));
        }
Esempio n. 13
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldHandleMultipleListConcatenation()
        internal virtual void ShouldHandleMultipleListConcatenation()
        {
            // Given
            ListValue inner1 = list(stringValue("foo"), longValue(42), booleanValue(true));
            ListValue inner2 = list(list(stringValue("bar"), intValue(42)));
            ListValue inner3 = list(map("foo", 1337L, "bar", 42), stringValue("baz"));

            // When
            ListValue concat = concat(inner1, inner2, inner3);

            // Then
            ListValue expected = list(stringValue("foo"), longValue(42), booleanValue(true), list(stringValue("bar"), intValue(42)), map("foo", 1337L, "bar", 42), stringValue("baz"));

            assertEquals(expected, concat);
            assertEquals(expected.GetHashCode(), concat.GetHashCode());
            assertArrayEquals(expected.AsArray(), concat.AsArray());
        }