!16 修复运行单个单元测试时,获取OpenAuth.WebApi配置文件路径异常的问题。

Merge pull request !16 from sesamefly/N/A
This commit is contained in:
李玉宝 2021-05-14 23:06:11 +08:00 committed by Gitee
commit d78b60764c

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using System.Reflection;
@ -39,7 +39,7 @@ namespace OpenAuth.Repository.Test
//模拟配置文件
//读取OpenAuth.WebApi的配置文件用于单元测试
var path = AppContext.BaseDirectory;
int pos = path.IndexOf("OpenAuth.Repository");
int pos = path.LastIndexOf("OpenAuth.");
var basepath = Path.Combine(path.Substring(0,pos) ,"OpenAuth.WebApi");
IConfiguration config = new ConfigurationBuilder()
.SetBasePath(basepath)