unit testing Code Clean-up module with various options?

I would like to unit test a code clean-up module with various options. Basically, my module has 1 associated Descriptor of type CodeCleanupEnumOptionDescriptor<MyOptions>. MyOptions is an enum with 3 values (None, All, ObjectsOnly). I would like to write a unit test (well, 3 really) that will test 1 or more files with each of the 3 settings.
Should I use DoTestFilesWithProfile()? if so, how? From what I see the .profile file associated with it just has a boolean for the class name of the module. Can I use it for setting my options?
I do see a ChangeSettingsTemporarily() on the CodeCleanupTestBase, but it takes a LifeTime and I have no idea how to get a LifeTime at this point.

Thanks in advance for the help. It's been a great adventure working the SDK.


P.S. I am working with the latest version of the 6.x SDK.

1 comment


In order to test a particular profile, your test method should simply call

— there’s actually an example of this in the SDK under
. Essentially, the first parameter is the name of the profile to test with, the second parameter is the name of the actual file to test.
As far as
is concerned, you can write the following:
Lifetime.Using(lifetime =>
     // use 'lifetime' here

Hope this helps,


Please sign in to leave a comment.