Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCollectBadRelationshipsEvenIfThresholdNeverReached() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldCollectBadRelationshipsEvenIfThresholdNeverReached()
        {
            // given
            int tolerance = 5;

            using (BadCollector badCollector = new BadCollector(BadOutputFile(), tolerance, BadCollector.COLLECT_ALL))
            {
                // when
                badCollector.CollectBadRelationship("1", "a", "T", "2", "b", "1");

                // then
                assertEquals(1, badCollector.BadEntries());
            }
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCollectUnlimitedNumberOfBadEntriesIfToldTo()
        public virtual void ShouldCollectUnlimitedNumberOfBadEntriesIfToldTo()
        {
            // GIVEN
            using (BadCollector collector = new BadCollector(NULL_OUTPUT_STREAM, UNLIMITED_TOLERANCE, COLLECT_ALL))
            {
                // WHEN
                int count = 10_000;
                for (int i = 0; i < count; i++)
                {
                    collector.CollectDuplicateNode(i, i, "group");
                }

                // THEN
                assertEquals(count, collector.BadEntries());
            }
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotCollectBadNodesIfWeShouldOnlyBeCollectingRelationships() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotCollectBadNodesIfWeShouldOnlyBeCollectingRelationships()
        {
            // given
            int tolerance = 1;

            using (BadCollector badCollector = new BadCollector(BadOutputFile(), tolerance, BadCollector.BAD_RELATIONSHIPS))
            {
                // when
                CollectBadRelationship(badCollector);
                try
                {
                    badCollector.CollectDuplicateNode(1, 1, "group");
                }
                catch (InputException)
                {
                    // then expect to end up here
                    assertEquals(1, badCollector.BadEntries());
                }
            }
        }