コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @SuppressWarnings("unchecked") public void shouldLogInconsistency() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
            public virtual void ShouldLogInconsistency()
            {
                // given
                InconsistencyReport        report   = mock(typeof(InconsistencyReport));
                ConsistencyReport_Reporter reporter = new ConsistencyReporter(mock(typeof(RecordAccess)), report);

                // when
                ReportMethod.invoke(reporter, Parameters(ReportMethod));

                // then
                if (Method.getAnnotation(typeof(ConsistencyReport_Warning)) == null)
                {
                    if (ReportMethod.Name.EndsWith("Change"))
                    {
                        verify(report).error(any(typeof(RecordType)), any(typeof(AbstractBaseRecord)), any(typeof(AbstractBaseRecord)), argThat(HasExpectedFormat()), any(typeof(object[])));
                    }
                    else
                    {
                        verify(report).error(any(typeof(RecordType)), any(typeof(AbstractBaseRecord)), argThat(HasExpectedFormat()), NullSafeAny());
                    }
                }
                else
                {
                    if (ReportMethod.Name.EndsWith("Change"))
                    {
                        verify(report).warning(any(typeof(RecordType)), any(typeof(AbstractBaseRecord)), any(typeof(AbstractBaseRecord)), argThat(HasExpectedFormat()), any(typeof(object[])));
                    }
                    else
                    {
                        verify(report).warning(any(typeof(RecordType)), any(typeof(AbstractBaseRecord)), argThat(HasExpectedFormat()), NullSafeAny());
                    }
                }
            }
コード例 #2
0
 public ErrorReporter(ReportMethod reporter)
 {
     Reporter = reporter;
 }