mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-08-24 07:22:55 +08:00
修复运行单个单元测试时,获取OpenAuth.WebApi配置文件路径异常的问题。
This commit is contained in:
parent
35a13a4772
commit
21f25fc42d
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@ -39,7 +39,7 @@ namespace OpenAuth.Repository.Test
|
|||||||
//模拟配置文件
|
//模拟配置文件
|
||||||
//读取OpenAuth.WebApi的配置文件用于单元测试
|
//读取OpenAuth.WebApi的配置文件用于单元测试
|
||||||
var path = AppContext.BaseDirectory;
|
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");
|
var basepath = Path.Combine(path.Substring(0,pos) ,"OpenAuth.WebApi");
|
||||||
IConfiguration config = new ConfigurationBuilder()
|
IConfiguration config = new ConfigurationBuilder()
|
||||||
.SetBasePath(basepath)
|
.SetBasePath(basepath)
|
||||||
|
Loading…
Reference in New Issue
Block a user