//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldThrowAppropriateExceptionIfStartFails() internal virtual void ShouldThrowAppropriateExceptionIfStartFails() { Exception startupError = new Exception(); GraphDatabaseFacadeFactory db = NewFaultyGraphDatabaseFacadeFactory(startupError); Exception startException = assertThrows(typeof(Exception), () => Db.initFacade(_testDirectory.storeDir(), Collections.emptyMap(), _deps, _mockFacade)); assertEquals(startupError, Exceptions.rootCause(startException)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldThrowAppropriateExceptionIfBothStartAndShutdownFail() internal virtual void ShouldThrowAppropriateExceptionIfBothStartAndShutdownFail() { Exception startupError = new Exception(); Exception shutdownError = new Exception(); GraphDatabaseFacadeFactory db = NewFaultyGraphDatabaseFacadeFactory(startupError); doThrow(shutdownError).when(_mockFacade).shutdown(); Exception initException = assertThrows(typeof(Exception), () => Db.initFacade(_testDirectory.storeDir(), Collections.emptyMap(), _deps, _mockFacade)); assertTrue(initException.Message.StartsWith("Error starting ")); assertEquals(startupError, initException.InnerException); assertEquals(shutdownError, initException.Suppressed[0]); }