Here is a small snippet for emacs hide-show mode that quickly folds all unittest blocks.
(defun my-d-mode-hide-unittest() "Hides unittest blocks" (interactive) (save-excursion (beginning-of-buffer) (while (search-forward "unittest" nil t) (progn (search-forward "{") (hs-hide-block)))))