TDD and System. DirectoryServices. AccountManagement

So I am hav­ing a bit of a prob­lem here.  Working on a sim­ple library for a client to help them main­tain their Active Directory entries pro­gra­mat­i­cal­ly.  Started with my tests.  (I took this oppor­tu­ni­ty to spike Machine.Specifications, which I am find­ing that I quite like, but that’s for a dif­fer­ent post.)  Then researched into the APIs avail­able from Microsoft.  At first, I was quite excit­ed about the System.DirectoryServices.AccountManagement name­space added in the 3.5 frame­work, until I tried to inject its class­es into my own.

Now I’m run­ning myself in cir­cles, try­ing to fig­ure out how to test my code with­out cre­at­ing (or worse, delet­ing) accounts on my devel­op­ment box.

Share