I want to write a test to check some settings in my app config files are present.
How would i go about getting all of the app/web config files in the solution?
I want to write a test to check some settings in my app config files are present.
How would i go about getting all of the app/web config files in the solution?
As far as i understand your post,
Please use following to get all files in a directory
public string[] GetAllFilesInDirectory(string path, string startsWith, string fileExt)
{
string[] filenames = Directory.GetFiles(path, startsWith + "*" + fileExt);
return filenames;
}
Usage:
string[] arr= GetAllFilesInDirectory(somepath,startswith,".config");
Hope this helps!