programmatically merge .reg file into win32 registry

后端 未结 5 2278
猫巷女王i
猫巷女王i 2021-01-18 21:36

What\'s the best way to programmatically merge a .reg file into the registry? This is for unit testing; the .reg file is a test artifact which will be added then removed at

5条回答
  •  轮回少年
    2021-01-18 21:48

    One of the most frustrating things about writing unit tests is dealing with dependencies. One of the greatest things about Test-Driven Development is that it produces code that is decoupled from its dependencies. Cool, huh?

    When I find myself asking questions like this one, I look for ways to decouple the code I'm writing from the dependency. Separate out the reading of the registry from the complexity that you'd like to test.

提交回复
热议问题