If they're not mockable (don't have MSDN at hand, so I can't really tell), you can always abstract them behind an IDirectorySearcher and IDirectoryEntry and mock these. With this approach you can simplify the API by tailoring it specifically to suit your needs.