Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void useCollectionsFactory()
        public virtual void UseCollectionsFactory()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.collections.api.set.primitive.MutableLongSet set1 = new org.eclipse.collections.impl.set.mutable.primitive.LongHashSet();
            MutableLongSet set1 = new LongHashSet();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.collections.api.set.primitive.MutableLongSet set2 = new org.eclipse.collections.impl.set.mutable.primitive.LongHashSet();
            MutableLongSet set2 = new LongHashSet();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.kernel.impl.util.collection.CollectionsFactory collectionsFactory = mock(org.neo4j.kernel.impl.util.collection.CollectionsFactory.class);
            CollectionsFactory collectionsFactory = mock(typeof(CollectionsFactory));

            doReturn(set1, set2).when(collectionsFactory).newLongSet();

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final MutableLongDiffSetsImpl diffSets = new MutableLongDiffSetsImpl(collectionsFactory);
            MutableLongDiffSetsImpl diffSets = new MutableLongDiffSetsImpl(collectionsFactory);

            diffSets.Add(1L);
            diffSets.Remove(2L);

            assertSame(set1, diffSets.Added);
            assertSame(set2, diffSets.Removed);
            verify(collectionsFactory, times(2)).newLongSet();
            verifyNoMoreInteractions(collectionsFactory);
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void removeAllElements()
        public virtual void RemoveAllElements()
        {
            MutableLongDiffSetsImpl diffSet = CreateDiffSet();

            diffSet.RemoveAll(newSetWith(7L, 8L));
            diffSet.RemoveAll(newSetWith(9L, 10L));

            assertEquals(asSet(7L, 8L, 9L, 10L), toSet(diffSet.Removed));
        }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void removeElementsInDiffSets()
        public virtual void RemoveElementsInDiffSets()
        {
            MutableLongDiffSetsImpl diffSets = CreateDiffSet();

            diffSets.Remove(1L);
            diffSets.Remove(2L);

            assertFalse(diffSets.Empty);
            assertEquals(asSet(1L, 2L), toSet(diffSets.Removed));
        }
Пример #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void addElementsToDiffSets()
        public virtual void AddElementsToDiffSets()
        {
            MutableLongDiffSetsImpl diffSets = CreateDiffSet();

            diffSets.Add(1L);
            diffSets.Add(2L);

            assertEquals(asSet(1L, 2L), toSet(diffSets.Added));
            assertTrue(diffSets.Removed.Empty);
            assertFalse(diffSets.Empty);
        }
Пример #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void addedAndRemovedElementsDelta()
        public virtual void AddedAndRemovedElementsDelta()
        {
            MutableLongDiffSetsImpl diffSet = CreateDiffSet();

            assertEquals(0, diffSet.Delta());

            diffSet.AddAll(newSetWith(7L, 8L));
            diffSet.AddAll(newSetWith(9L, 10L));
            assertEquals(4, diffSet.Delta());

            diffSet.RemoveAll(newSetWith(8L, 9L));
            assertEquals(2, diffSet.Delta());
        }
Пример #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void checkIsElementsAddedOrRemoved()
        public virtual void CheckIsElementsAddedOrRemoved()
        {
            MutableLongDiffSetsImpl diffSet = CreateDiffSet();

            diffSet.Add(1L);

            assertTrue(diffSet.IsAdded(1L));
            assertFalse(diffSet.IsRemoved(1L));

            diffSet.Remove(2L);

            assertFalse(diffSet.IsAdded(2L));
            assertTrue(diffSet.IsRemoved(2L));

            assertFalse(diffSet.IsAdded(3L));
            assertFalse(diffSet.IsRemoved(3L));
        }