### Question:
FileOperationManager implements IFileOperationManager { @Nonnull public FileIOError deleteDir (@Nonnull final File aDir) { m_aLastError = FileOperations.deleteDir (aDir); _handleLastError (m_aLastError); return m_aLastError; } FileOperationManager(); @Nonnull @ReturnsMutableObject CallbackList <IFileOperationCallback> callbacks(); @Nullable FileIOError getLastError(); @Nullable EFileIOOperation getLastOperation(); @Nonnull FileIOError createDir(@Nonnull final File aDir); @Nonnull FileIOError createDirIfNotExisting(@Nonnull final File aDir); @Nonnull FileIOError createDirRecursive(@Nonnull final File aDir); @Nonnull FileIOError createDirRecursiveIfNotExisting(@Nonnull final File aDir); @Nonnull FileIOError deleteDir(@Nonnull final File aDir); @Nonnull FileIOError deleteDirIfExisting(@Nonnull final File aDir); @Nonnull FileIOError deleteDirRecursive(@Nonnull final File aDir); @Nonnull FileIOError deleteDirRecursiveIfExisting(@Nonnull final File aDir); @Nonnull FileIOError deleteFile(@Nonnull final File aFile); @Nonnull FileIOError deleteFileIfExisting(@Nonnull final File aFile); @Nonnull FileIOError renameDir(@Nonnull final File aSourceDir, @Nonnull final File aTargetDir); @Nonnull FileIOError renameFile(@Nonnull final File aSourceFile, @Nonnull final File aTargetFile); @Nonnull FileIOError copyDirRecursive(@Nonnull final File aSourceDir, @Nonnull final File aTargetDir); @Nonnull FileIOError copyFile(@Nonnull final File aSourceFile, @Nonnull final File aTargetFile); @Override String toString(); static final IFileOperationManager INSTANCE; }### Answer:
@Test public void testDeleteDir () { final IFileOperationManager aFOM = new FileOperationManager (); final File aDir = new File ("deldir.test"); try { assertFalse (FileHelper.existsDir (aDir)); _expectedError (aFOM.deleteDir (aDir), EFileIOErrorCode.SOURCE_DOES_NOT_EXIST); assertEquals (EFileIOOperation.DELETE_DIR, aFOM.getLastOperation ()); _expectedSuccess (aFOM.createDir (aDir)); assertEquals (EFileIOOperation.CREATE_DIR, aFOM.getLastOperation ()); _expectedError (aFOM.deleteFile (aDir), EFileIOErrorCode.SOURCE_DOES_NOT_EXIST); assertEquals (EFileIOOperation.DELETE_FILE, aFOM.getLastOperation ()); _expectedSuccess (aFOM.deleteDir (aDir)); assertEquals (EFileIOOperation.DELETE_DIR, aFOM.getLastOperation ()); } finally { aFOM.deleteDir (aDir); assertEquals (EFileIOOperation.DELETE_DIR, aFOM.getLastOperation ()); } }