Exemplo n.º 1
0
            internal virtual ProgressMonitorFactory Mock(Indicator indicatorMock, int indicatorSteps)
            {
                when(indicatorMock.ReportResolution()).thenReturn(indicatorSteps);
                ProgressMonitorFactory factory = Mockito.mock(typeof(ProgressMonitorFactory));

                when(factory.NewIndicator(any(typeof(string)))).thenReturn(indicatorMock);
                FactoryMocks[factory] = false;
                return(factory);
            }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldPrintADotEveryHalfPercentAndFullPercentageEveryTenPercentWithTextualIndicator() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldPrintADotEveryHalfPercentAndFullPercentageEveryTenPercentWithTextualIndicator()
        {
            // given
            MemoryStream     stream           = new MemoryStream();
            ProgressListener progressListener = ProgressMonitorFactory.Textual(stream).singlePart(TestName.MethodName, 1000);

            // when
            for (int i = 0; i < 1000; i++)
            {
                progressListener.Add(1);
            }

            // then
            assertEquals(TestName.MethodName + lineSeparator() + _expectedTextualOutput, stream.ToString(Charset.defaultCharset().name()));
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldPrintADotEveryHalfPercentAndFullPercentageEveryTenPercentEvenWhenStepResolutionIsLower()
        public virtual void ShouldPrintADotEveryHalfPercentAndFullPercentageEveryTenPercentEvenWhenStepResolutionIsLower()
        {
            // given
            StringWriter     writer           = new StringWriter();
            ProgressListener progressListener = ProgressMonitorFactory.Textual(writer).singlePart(TestName.MethodName, 50);

            // when
            for (int i = 0; i < 50; i++)
            {
                progressListener.Add(1);
            }

            // then
            assertEquals(TestName.MethodName + lineSeparator() + _expectedTextualOutput, writer.ToString());
        }
Exemplo n.º 4
0
 internal MultiPartBuilder(ProgressMonitorFactory factory, string process)
 {
     this.Aggregator = new Aggregator(factory.NewIndicator(process));
 }