单元测试:测试文件增加多数据库配置项
This commit is contained in:
parent
2f5be3a1d0
commit
5e188ebfcf
|
@ -8,9 +8,19 @@ namespace Bootstrap.DataAccess
|
||||||
{
|
{
|
||||||
public BootstrapAdminStartup()
|
public BootstrapAdminStartup()
|
||||||
{
|
{
|
||||||
|
var sqlConnectionStrings = "Data Source=.;Initial Catalog=UnitTest;User ID=sa;Password=sa";
|
||||||
|
var mysqlConnectionStrings = "Server=10.211.55.2;Database=BA;Uid=argozhang;Pwd=argo@163.com;SslMode=none;";
|
||||||
var config = new ConfigurationBuilder().AddInMemoryCollection(new KeyValuePair<string, string>[] {
|
var config = new ConfigurationBuilder().AddInMemoryCollection(new KeyValuePair<string, string>[] {
|
||||||
new KeyValuePair<string, string>("ConnectionStrings:ba", "Data Source=.;Initial Catalog=UnitTest;User ID=sa;Password=sa"),
|
new KeyValuePair<string, string>("ConnectionStrings:ba", sqlConnectionStrings),
|
||||||
new KeyValuePair<string, string>("DB:0:Enabled", "false"),
|
new KeyValuePair<string, string>("DB:0:Enabled", "false"),
|
||||||
|
|
||||||
|
new KeyValuePair<string, string>("DB:1:Enabled", "false"),
|
||||||
|
new KeyValuePair<string, string>("DB:1:ProviderName", "SQLite"),
|
||||||
|
new KeyValuePair<string, string>("DB:1:ConnectionStrings:ba", "Data Source=UnitTest.db"),
|
||||||
|
|
||||||
|
new KeyValuePair<string, string>("DB:2:Enabled", "false"),
|
||||||
|
new KeyValuePair<string, string>("DB:2:ProviderName", "MySql"),
|
||||||
|
new KeyValuePair<string, string>("DB:2:ConnectionStrings:ba", mysqlConnectionStrings),
|
||||||
new KeyValuePair<string, string>("LongbowCache:Enabled", "false")
|
new KeyValuePair<string, string>("LongbowCache:Enabled", "false")
|
||||||
}).Build();
|
}).Build();
|
||||||
var sc = new ServiceCollection();
|
var sc = new ServiceCollection();
|
||||||
|
|
Loading…
Reference in New Issue