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