示例#1
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);
        }
示例#2
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);
        }
示例#3
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));
        }