Unit testing the app.config file with NUnit

后端 未结 13 2299
夕颜
夕颜 2020-12-04 16:37

When you guys are unit testing an application that relies on values from an app.config file? How do you test that those values are read in correctly and how your program re

13条回答
  •  清歌不尽
    2020-12-04 17:00

    System.Configuration.Abstractions is a thing of beauty when it comes to testing this kind of stuff.

    Here is the GitHub project site with some good examples: enter link description here

    Here is the NuGet site: https://www.nuget.org/packages/System.Configuration.Abstractions/

    I use this in almost all of my .NET projects.

提交回复
热议问题