I have a list like following in config.json file `
{
\"foo\": {
\"bar\": [
\"1\",
\"2\",
\"3\"
]
}
}`
I am ab
You can try alternative ways. For example, you can try to create an instance of ConfigurationBuilder in your test class:
string projectPath = AppDomain.CurrentDomain.BaseDirectory.Split(new String[] { @"bin\" }, StringSplitOptions.None)[0];
IConfiguration config = new ConfigurationBuilder()
.SetBasePath(projectPath)
.AddJsonFile("config.json")
.Build();
Note: Please don't forget to add your config.json file to your test project too.