Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void onlyDatabaseErrorsAreLogged()
        public virtual void OnlyDatabaseErrorsAreLogged()
        {
            AssertableLogProvider userLog     = new AssertableLogProvider();
            AssertableLogProvider internalLog = new AssertableLogProvider();
            ErrorReporter         reporter    = NewErrorReporter(userLog, internalLog);

            foreach (Org.Neo4j.Kernel.Api.Exceptions.Status_Classification classification in Enum.GetValues(typeof(Org.Neo4j.Kernel.Api.Exceptions.Status_Classification)))
            {
                if (classification != Org.Neo4j.Kernel.Api.Exceptions.Status_Classification.DatabaseError)
                {
                    Org.Neo4j.Kernel.Api.Exceptions.Status_Code code = NewStatusCode(classification);
                    Neo4jError error = Neo4jError.from(() => code, "Database error");
                    reporter.Report(error);

                    userLog.AssertNoLoggingOccurred();
                    internalLog.AssertNoLoggingOccurred();
                }
            }
        }
Example #2
0
 private static Org.Neo4j.Kernel.Api.Exceptions.Status_Code NewStatusCode(Org.Neo4j.Kernel.Api.Exceptions.Status_Classification classification)
 {
     Org.Neo4j.Kernel.Api.Exceptions.Status_Code code = mock(typeof(Org.Neo4j.Kernel.Api.Exceptions.Status_Code));
     when(code.Classification()).thenReturn(classification);
     return(code);
 }