File tree Expand file tree Collapse file tree 4 files changed +29
-15
lines changed
Common.PesudoStatic/src/Tests Expand file tree Collapse file tree 4 files changed +29
-15
lines changed Original file line number Diff line number Diff line change 1010 考虑Finance.Payment.Cash的实现
1111 考虑Finance.Payment.OnArrive的实现
1212
13+ 管理后台左边栏可以记住是否收缩
14+
1315====================================================================
1416
1517优化查询性能,添加更多的索引
Original file line number Diff line number Diff line change 1- using NSubstitute ;
2- using System ;
1+ using System ;
32using ZKWeb . Plugins . Common . Base . src . Domain . Services ;
43using ZKWeb . Plugins . Common . PesudoStatic . src . Components . GenericConfigs ;
54using ZKWeb . Plugins . Common . PesudoStatic . src . Components . HttpRequestHandlers ;
109namespace 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 ( ) ;
Original file line number Diff line number Diff line change 1- using NSubstitute ;
2- using System ;
1+ using System ;
32using ZKWeb . Plugins . Common . Base . src . Domain . Services ;
43using ZKWeb . Plugins . Common . PesudoStatic . src . Components . GenericConfigs ;
54using ZKWeb . Plugins . Common . PesudoStatic . src . Components . PesudoStatic . Enums ;
65using ZKWeb . Plugins . Common . PesudoStatic . src . Components . UrlFilters ;
6+ using ZKWeb . Plugins . Common . PesudoStatic . src . Tests . HttpRequestHandlers ;
77using ZKWebStandard . Testing ;
88
99namespace 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 ( "" ) , "" ) ;
Original file line number Diff line number Diff line change 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 >
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 >
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
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" />
You can’t perform that action at this time.
0 commit comments