C#: Run each unit test with different configuration file

后端 未结 2 2126
醉酒成梦
醉酒成梦 2021-01-23 00:05

I\'m currently developing a plugin to use in any application, and the configuration of the plugin is done through the usage of either a web.config or an app.config file.

2条回答
  •  囚心锁ツ
    2021-01-23 00:47

    My recommendation is to mock the integration with the config file instead of using it directly. This approach offers much more flexibility and removes the need to worry about multiple config files. You can either use a mocking framework or create you own layer of abstraction on top of the code that fetches the config values.

提交回复
热议问题