mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
!16 修复运行单个单元测试时,获取OpenAuth.WebApi配置文件路径异常的问题。
Merge pull request !16 from sesamefly/N/A
This commit is contained in:
commit
d78b60764c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user