🎩 Tricks the configuration manager into loading a custom App.config if you want
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Swindler.Tests
Swindler
packages
scripts
tools
.gitignore
CHANGELOG.md
LICENSE.md
README.md
Swindler.sln

README.md

Swindler

Small utility that can trick ConfigurationManager into loading its configuration from an App.config that YOU specify.

Can be useful for testing units that are sprinkled with

var dis = ConfigurationManager.AppSetting["key"];

and

var dat = ConfigurationManager.ConnectionStrings["name"];

How to use it

You can use it like this:

using (AppConfig.Use("Fake.App.config"))
{
    var appSetting = ConfigurationManager.AppSettings["fake"];
    
    Console.WriteLine($"This is from the fake App.config: {appSetting}");
}

Remember to dispose it after use.

How to get started

Install-Package Swindler -ProjectName <your-project>