Registry clean

4 views
Skip to first unread message

swapna chappidi

unread,
Mar 30, 2011, 10:23:02 AM3/30/11
to NUnit-Discuss
Hi,
Does anyone how to clean start an apllication with its default registry values?

swapna chappidi

unread,
Mar 30, 2011, 10:35:36 AM3/30/11
to NUnit-Discuss
To make it clearer, I start an application with its default registry setting in NUnit. I make few changes and teh default registry values get changed and the application starts with the changed registry values.
Is there any way that I could start reset all the registry values for the application before starting the application using NUnit?

Charlie Poole

unread,
Mar 30, 2011, 11:30:11 AM3/30/11
to nunit-...@googlegroups.com
Ideally, your tests should not change registry values at all. Rather,
you should provide
an interface to the registry, which you can fake when you run your
tests. Another
useful technique is to inject the registry values into your class,
pushing the access
to the registry to a higher level.

However, if you are already setting registry values, I suggest you
change them in
an appropriate level of setup, saving the original values. Then set them back
as they were in teardown.

A final technique, which I recommend, is to use an entirely different key for
the registry when running tests.

Charlie

> --
> You received this message because you are subscribed to the Google Groups
> "NUnit-Discuss" group.
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to
> nunit-discus...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nunit-discuss?hl=en.
>

Reply all
Reply to author
Forward
0 new messages