コード例 #1
0
        // symmetricDifference()

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void symDiff_shouldHandleNullInput()
        internal virtual void SymDiffShouldHandleNullInput()
        {
            assertThat(PrimitiveArrays.SymmetricDifference(null, null), equalTo(null));
            assertThat(PrimitiveArrays.SymmetricDifference(null, _noLongs), equalTo(_noLongs));
            assertThat(PrimitiveArrays.SymmetricDifference(_noLongs, null), equalTo(_noLongs));
            assertThat(PrimitiveArrays.SymmetricDifference(null, _oneLong), equalTo(_oneLong));
            assertThat(PrimitiveArrays.SymmetricDifference(_oneLong, null), equalTo(_oneLong));
        }
コード例 #2
0
        // intersect()

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void intersect_shouldHandleNullInput()
        internal virtual void IntersectShouldHandleNullInput()
        {
            assertThat(PrimitiveArrays.Intersect(null, null), equalTo(_noLongs));
            assertThat(PrimitiveArrays.Intersect(null, _noLongs), equalTo(_noLongs));
            assertThat(PrimitiveArrays.Intersect(_noLongs, null), equalTo(_noLongs));
            assertThat(PrimitiveArrays.Intersect(null, _oneLong), equalTo(_noLongs));
            assertThat(PrimitiveArrays.Intersect(_oneLong, null), equalTo(_noLongs));
        }
コード例 #3
0
        // union() null checks. Actual behaviour is tested in PrimitiveSortedArraySetUnionTest

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void union_shouldHandleNullInput()
        internal virtual void UnionShouldHandleNullInput()
        {
            assertThat(PrimitiveArrays.Union(null, null), nullValue());
            assertThat(PrimitiveArrays.Union(null, _noInts), equalTo(_noInts));
            assertThat(PrimitiveArrays.Union(_noInts, null), equalTo(_noInts));
            assertThat(PrimitiveArrays.Union(null, _oneInt), equalTo(_oneInt));
            assertThat(PrimitiveArrays.Union(_oneInt, null), equalTo(_oneInt));
        }
コード例 #4
0
        // count unique

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldCountUnique()
        internal virtual void ShouldCountUnique()
        {
            assertThat(PrimitiveArrays.CountUnique(new long[] { 1, 2, 3 }, new long[] { 4, 5, 6 }), IsIntPair(3, 3));

            assertThat(PrimitiveArrays.CountUnique(new long[] { 1, 2, 3 }, new long[] { 3, 6 }), IsIntPair(2, 1));

            assertThat(PrimitiveArrays.CountUnique(new long[] { 1, 2, 3 }, new long[] { 3 }), IsIntPair(2, 0));

            assertThat(PrimitiveArrays.CountUnique(new long[] { 3 }, new long[] { 1, 2, 3 }), IsIntPair(0, 2));

            assertThat(PrimitiveArrays.CountUnique(new long[] { 3 }, new long[] { 3 }), IsIntPair(0, 0));

            assertThat(PrimitiveArrays.CountUnique(new long[] { 3, 6, 8 }, new long[] {}), IsIntPair(3, 0));

            assertThat(PrimitiveArrays.CountUnique(new long[] {}, new long[] { 3, 6, 8 }), IsIntPair(0, 3));

            assertThat(PrimitiveArrays.CountUnique(new long[] {}, new long[] {}), IsIntPair(0, 0));

            assertThat(PrimitiveArrays.CountUnique(new long[] { 4, 6, 9, 11, 12, 15 }, new long[] { 2, 3, 4, 7, 8, 9, 12, 16, 19 }), IsIntPair(3, 6));
        }
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void intersect_shouldHandleComplexIntersectingArraysWithGaps()
        internal virtual void IntersectShouldHandleComplexIntersectingArraysWithGaps()
        {
            assertThat(PrimitiveArrays.Intersect(new long[] { 4, 6, 9, 11, 12, 15 }, new long[] { 2, 3, 4, 7, 8, 9, 12, 16, 19 }), IsArray(4, 9, 12));
            assertThat(PrimitiveArrays.Intersect(new long[] { 2, 3, 4, 7, 8, 9, 12, 16, 19 }, new long[] { 4, 6, 9, 11, 12, 15 }), IsArray(4, 9, 12));
        }
コード例 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void intersect_shouldHandleIntersectingArrays()
        internal virtual void IntersectShouldHandleIntersectingArrays()
        {
            assertThat(PrimitiveArrays.Intersect(new long[] { 1, 2, 3 }, new long[] { 3, 4, 5 }), IsArray(3));

            assertThat(PrimitiveArrays.Intersect(new long[] { 3, 4, 5 }, new long[] { 1, 2, 3, 4 }), IsArray(3, 4));
        }
コード例 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void intersect_shouldHandleNonIntersectingArrays()
        internal virtual void IntersectShouldHandleNonIntersectingArrays()
        {
            assertThat(PrimitiveArrays.Intersect(new long[] { 1, 2, 3 }, new long[] { 4, 5, 6 }), equalTo(_noLongs));

            assertThat(PrimitiveArrays.Intersect(new long[] { 14, 15, 16 }, new long[] { 1, 2, 3 }), equalTo(_noLongs));
        }
コード例 #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void symDiff_shouldHandleComplexIntersectingArraysWithGaps()
        internal virtual void SymDiffShouldHandleComplexIntersectingArraysWithGaps()
        {
            assertThat(PrimitiveArrays.SymmetricDifference(new long[] { 4, 6, 9, 11, 12, 15 }, new long[] { 2, 3, 4, 7, 8, 9, 12, 16, 19 }), IsArray(2, 3, 6, 7, 8, 11, 15, 16, 19));
            assertThat(PrimitiveArrays.SymmetricDifference(new long[] { 2, 3, 4, 7, 8, 9, 12, 16, 19 }, new long[] { 4, 6, 9, 11, 12, 15 }), IsArray(2, 3, 6, 7, 8, 11, 15, 16, 19));
        }
コード例 #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void symDiff_shouldHandleIntersectingArrays()
        internal virtual void SymDiffShouldHandleIntersectingArrays()
        {
            assertThat(PrimitiveArrays.SymmetricDifference(new long[] { 1, 2, 3 }, new long[] { 3, 4, 5 }), IsArray(1, 2, 4, 5));

            assertThat(PrimitiveArrays.SymmetricDifference(new long[] { 3, 4, 5 }, new long[] { 1, 2, 3, 4 }), IsArray(1, 2, 5));
        }
コード例 #10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void symDiff_shouldHandleNonIntersectingArrays()
        internal virtual void SymDiffShouldHandleNonIntersectingArrays()
        {
            assertThat(PrimitiveArrays.SymmetricDifference(new long[] { 1, 2, 3 }, new long[] { 4, 5, 6 }), IsArray(1, 2, 3, 4, 5, 6));

            assertThat(PrimitiveArrays.SymmetricDifference(new long[] { 14, 15, 16 }, new long[] { 1, 2, 3 }), IsArray(1, 2, 3, 14, 15, 16));
        }