Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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>

About

🎩 Tricks the configuration manager into loading a custom App.config if you want

Resources

License

Releases

No releases published

Packages

No packages published