Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void backupIsValidIfAnySingleStrategyPasses_secondFails() throws org.neo4j.commandline.admin.CommandFailed
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void BackupIsValidIfAnySingleStrategyPassesSecondFails()
        {
            // given
            when(_firstStrategy.doBackup(any())).thenReturn(new Fallible <>(BackupStrategyOutcome.Success, null));
            when(_secondStrategy.doBackup(any())).thenReturn(new Fallible <>(BackupStrategyOutcome.IncorrectStrategy, null));

            // when
            _subject.performBackup(_onlineBackupContext);

            // then no exception
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void havingNoStrategiesCausesAllSolutionsFailedException() throws org.neo4j.commandline.admin.CommandFailed
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void HavingNoStrategiesCausesAllSolutionsFailedException()
        {
            // given there are no strategies in the solution
            _subject = new BackupStrategyCoordinator(_consistencyCheckService, _outsideWorld, _logProvider, _progressMonitorFactory, Collections.emptyList());

            // then we want a predictable exception (instead of NullPointer)
            ExpectedException.expect(typeof(CommandFailed));
            ExpectedException.expectMessage("Failed to run a backup using the available strategies.");

            // when
            _subject.performBackup(_onlineBackupContext);
        }