示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void pruneStrategyExceedsNumberOfEntriesTest()
        public virtual void PruneStrategyExceedsNumberOfEntriesTest()
        {
            //given
            Files = CreateSegmentFiles(10).subList(5, 10);
            EntryBasedLogPruningStrategy strategy = new EntryBasedLogPruningStrategy(7, mock(typeof(LogProvider)));

            //when
            long indexToKeep = strategy.GetIndexToKeep(Segments);

            //then
            assertEquals(4, indexToKeep);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void onlyOneActiveLogFileTest()
        public virtual void OnlyOneActiveLogFileTest()
        {
            //given
            Files = CreateSegmentFiles(6).subList(4, 6);
            EntryBasedLogPruningStrategy strategy = new EntryBasedLogPruningStrategy(6, mock(typeof(LogProvider)));

            //when
            long indexToKeep = strategy.GetIndexToKeep(Segments);

            //then
            assertEquals(3, indexToKeep);
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void indexToKeepTest()
        public virtual void IndexToKeepTest()
        {
            // given
            Files = CreateSegmentFiles(10);
            EntryBasedLogPruningStrategy strategy = new EntryBasedLogPruningStrategy(6, mock(typeof(LogProvider)));

            // when
            long indexToKeep = strategy.GetIndexToKeep(Segments);

            // then
            assertEquals(2, indexToKeep);
        }