Skip to content

Commit

Permalink
修正配置系统的单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jan 31, 2020
1 parent 1754b17 commit 61b4201
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ bld/
/BinSamples
/Samples/SplitTableOrDatabase/Config
/TestResults
/BinCoreTest
/BinXCodeTest
1 change: 1 addition & 0 deletions NewLife.Core/Configuration/FileConfigProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public override void Save<T>(T model, String nameSpace = null)

var fileName = GetFileName(typeof(T));
fileName = fileName.GetBasePath();
fileName.EnsureDirectory(true);

OnWrite(fileName, dic);
}
Expand Down
4 changes: 2 additions & 2 deletions NewLife.Core/NewLife.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<Description>算法、日志、网络、RPC、序列化、缓存、Windows服务、线程池</Description>
<Company>新生命开发团队</Company>
<Copyright>©2002-2020 NewLife</Copyright>
<Version>8.5.2020.0130</Version>
<FileVersion>8.5.2020.0130</FileVersion>
<Version>8.5.2020.0129</Version>
<FileVersion>8.5.2020.0129</FileVersion>
<AssemblyVersion>8.5.*</AssemblyVersion>
<Deterministic>false</Deterministic>
<OutputPath>..\..\Bin</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion XUnitTest.Core/Configuration/JsonConfigProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void TestBind()
}";

var prv = new JsonConfigProvider { FileName = "Config/core2.json" };
var file = prv.FileName.GetFullPath();
var file = prv.FileName.GetFullPath().EnsureDirectory(true);
File.WriteAllText(file, json);

var set = new ConfigModel();
Expand Down
2 changes: 1 addition & 1 deletion XUnitTest.Core/Configuration/XmlConfigProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void TestBind()
</core>";

var prv = new XmlConfigProvider { FileName = "Config/core2.xml" };
var file = prv.FileName.GetFullPath();
var file = prv.FileName.GetFullPath().EnsureDirectory(true);
File.WriteAllText(file, json);

var set = new ConfigModel();
Expand Down
1 change: 1 addition & 0 deletions XUnitTest.Core/XUnitTest.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<OutputPath>..\BinCoreTest</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
Expand Down
2 changes: 1 addition & 1 deletion XUnitTest.XCode/XUnitTest.XCode.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<OutputPath>..\BinXCodeTest</OutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
Expand Down

0 comments on commit 61b4201

Please sign in to comment.