Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void anEmptySetContainsNothing()
        public virtual void AnEmptySetContainsNothing()
        {
            // given
            object aValue = new object();

            // when
            MultiSet <object> emptyMultiSet = new MultiSet <object>();

            // then
            assertTrue(emptyMultiSet.Empty);
            assertEquals(0, emptyMultiSet.Size());
            assertEquals(0, emptyMultiSet.UniqueSize());
            assertFalse(emptyMultiSet.Contains(aValue));
            assertEquals(0, emptyMultiSet.Count(aValue));
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAddAnElementToTheMultiSet()
        public virtual void ShouldAddAnElementToTheMultiSet()
        {
            // given
            MultiSet <object> multiSet = new MultiSet <object>();
            object            value    = new object();

            // when
            long count = multiSet.Add(value);

            // then
            assertEquals(1, count);
            assertFalse(multiSet.Empty);
            assertEquals(1, multiSet.Size());
            assertEquals(1, multiSet.UniqueSize());
            assertTrue(multiSet.Contains(value));
            assertEquals(1, multiSet.Count(value));
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldClearTheMultiSet()
        public virtual void ShouldClearTheMultiSet()
        {
            // given
            MultiSet <object> multiSet = new MultiSet <object>();
            object            value    = new object();

            multiSet.Add(value);
            multiSet.Add(value);
            multiSet.Add(new object());

            // when
            multiSet.Clear();

            // then
            assertTrue(multiSet.Empty);
            assertEquals(0, multiSet.Size());
            assertEquals(0, multiSet.UniqueSize());
            assertFalse(multiSet.Contains(value));
            assertEquals(0, multiSet.Count(value));
        }