Skip to content

Commit abcb8da

Browse files
committed
update to zkweb 2.0.0
1 parent 316e516 commit abcb8da

File tree

4 files changed

+29
-15
lines changed

4 files changed

+29
-15
lines changed

doc/other_todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
考虑Finance.Payment.Cash的实现
1111
考虑Finance.Payment.OnArrive的实现
1212

13+
管理后台左边栏可以记住是否收缩
14+
1315
====================================================================
1416

1517
优化查询性能,添加更多的索引

src/ZKWeb.Plugins/Common.PesudoStatic/src/Tests/HttpRequestHandlers/PesudoStaticHandlerTest.cs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using NSubstitute;
2-
using System;
1+
using System;
32
using ZKWeb.Plugins.Common.Base.src.Domain.Services;
43
using ZKWeb.Plugins.Common.PesudoStatic.src.Components.GenericConfigs;
54
using ZKWeb.Plugins.Common.PesudoStatic.src.Components.HttpRequestHandlers;
@@ -10,13 +9,27 @@
109
namespace ZKWeb.Plugins.Common.PesudoStatic.src.Tests.HttpRequestHandlers {
1110
[Tests]
1211
class PesudoStaticHandlerTest {
12+
public class GenericConfigManagerMock : GenericConfigManager {
13+
private PesudoStaticSettings _settings;
14+
15+
public GenericConfigManagerMock(PesudoStaticSettings settings) {
16+
_settings = settings;
17+
}
18+
19+
public override T GetData<T>() {
20+
if (typeof(T) == typeof(PesudoStaticSettings)) {
21+
return (T)(object)_settings;
22+
}
23+
return base.GetData<T>();
24+
}
25+
}
26+
1327
public void OnRequest() {
1428
var settings = new PesudoStaticSettings();
1529
using (Application.OverrideIoc()) {
16-
var configManagerMock = Substitute.For<GenericConfigManager>();
17-
configManagerMock.GetData<PesudoStaticSettings>().Returns(settings);
1830
Application.Ioc.Unregister<GenericConfigManager>();
19-
Application.Ioc.RegisterInstance(configManagerMock);
31+
Application.Ioc.RegisterInstance<GenericConfigManager>(
32+
new GenericConfigManagerMock(new PesudoStaticSettings()));
2033
var testUrl = new Func<string, string>(url => {
2134
string parsedUrl = null;
2235
var wrapper = new PesudoStaticHandlerWrapper();

src/ZKWeb.Plugins/Common.PesudoStatic/src/Tests/UrlFilters/PesudoStaticUrlFilterTest.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using NSubstitute;
2-
using System;
1+
using System;
32
using ZKWeb.Plugins.Common.Base.src.Domain.Services;
43
using ZKWeb.Plugins.Common.PesudoStatic.src.Components.GenericConfigs;
54
using ZKWeb.Plugins.Common.PesudoStatic.src.Components.PesudoStatic.Enums;
65
using ZKWeb.Plugins.Common.PesudoStatic.src.Components.UrlFilters;
6+
using ZKWeb.Plugins.Common.PesudoStatic.src.Tests.HttpRequestHandlers;
77
using ZKWebStandard.Testing;
88

99
namespace ZKWeb.Plugins.Common.PesudoStatic.src.Tests.UrlFilters {
@@ -15,10 +15,9 @@ public void Filter() {
1515
settings.ExcludeUrlPaths.Add("/exclude/me");
1616
using (Application.OverrideIoc()) {
1717
var filter = new PesudoStaticUrlFilter();
18-
var configManagerMock = Substitute.For<GenericConfigManager>();
19-
configManagerMock.GetData<PesudoStaticSettings>().Returns(settings);
2018
Application.Ioc.Unregister<GenericConfigManager>();
21-
Application.Ioc.RegisterInstance(configManagerMock);
19+
Application.Ioc.RegisterInstance<GenericConfigManager>(
20+
new PesudoStaticHandlerTest.GenericConfigManagerMock(settings));
2221
var testUrl = new Func<string, string>(url => { filter.Filter(ref url); return url; });
2322

2423
Assert.Equals(testUrl(""), "");

src/ZKWeb.Plugins/ZKWeb.Plugins.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net461;netstandard1.6</TargetFrameworks>
4+
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
55
<AssemblyName>ZKWeb.Plugins</AssemblyName>
66
<PackageId>ZKWeb.Plugins</PackageId>
77
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
@@ -11,8 +11,8 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="ZKWeb" Version="1.9.0.1" />
15-
<PackageReference Include="ZKWeb.Fork.QRCoder" Version="1.2.8.1" />
14+
<PackageReference Include="ZKWeb" Version="2.0.0" />
15+
<PackageReference Include="ZKWeb.Fork.QRCoder" Version="1.3.0" />
1616
<PackageReference Include="System.ComponentModel.Annotations" Version="4.3.0" />
1717
<PackageReference Include="System.Net.Requests " Version="4.3.0" />
1818
</ItemGroup>
@@ -24,7 +24,7 @@
2424
<Reference Include="System.Speech" />
2525
</ItemGroup>
2626

27-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
27+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
2828
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
2929
</PropertyGroup>
3030

@@ -36,7 +36,7 @@
3636
<DocumentationFile>bin\Debug\netstandard1.6\ZKWeb.Plugins.xml</DocumentationFile>
3737
</PropertyGroup>
3838

39-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
39+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
4040
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
4141
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />
4242
<PackageReference Include="System.Reflection.Extensions" Version="4.3.0" />

0 commit comments

Comments
 (0)