diff --git a/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpTestModule.cs b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpTestModule.cs index 4a150a2c19..ee3ad9ec57 100644 --- a/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpTestModule.cs +++ b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/AbpHttpTestModule.cs @@ -1,6 +1,9 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.App; +using Volo.Abp.AspNetCore.Modularity; using Volo.Abp.Http.Client; +using Volo.Abp.Http.DynamicProxying; using Volo.Abp.Modularity; using Volo.Abp.TestApp.Application; @@ -13,6 +16,12 @@ namespace Volo.Abp.Http { services.AddAssemblyOf(); services.AddHttpClientProxy("/"); + services.AddHttpClientProxy("/"); + + services.Configure(options => + { + + }); } } } diff --git a/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/IRegularTestController.cs b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/IRegularTestController.cs new file mode 100644 index 0000000000..7105b6edb6 --- /dev/null +++ b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/IRegularTestController.cs @@ -0,0 +1,7 @@ +namespace Volo.Abp.Http.DynamicProxying +{ + public interface IRegularTestController + { + int IncrementValue(int value); + } +} diff --git a/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularControllerClientProxy_Tests.cs b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularControllerClientProxy_Tests.cs deleted file mode 100644 index 49f441c8f2..0000000000 --- a/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularControllerClientProxy_Tests.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Volo.Abp.Http.DynamicProxying -{ - public class RegularControllerClientProxy_Tests - { - //TODO: Create a regular MVC Controller and add different parameter bindings, verbs and routes and test client proxy for it! - } -} diff --git a/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs new file mode 100644 index 0000000000..49b41a5fae --- /dev/null +++ b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestController.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace Volo.Abp.Http.DynamicProxying +{ + [RemoteService] //Automatically enables API explorer and apply ABP conventions. + //[ApiExplorerSettings(IgnoreApi = false)] //alternative + public class RegularTestController : AbpController, IRegularTestController + { + [HttpGet] + [Route("api/regular-test-controller/{value}")] + public int IncrementValue(int value) + { + return value + 1; + } + } +} \ No newline at end of file diff --git a/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs new file mode 100644 index 0000000000..9098371614 --- /dev/null +++ b/test/Volo.Abp.Http.Client.Tests/Volo/Abp/Http/DynamicProxying/RegularTestControllerClientProxy_Tests.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.DependencyInjection; +using Shouldly; +using Xunit; + +namespace Volo.Abp.Http.DynamicProxying +{ + public class RegularTestControllerClientProxy_Tests : AbpHttpTestBase + { + //TODO: Create a regular MVC Controller and add different parameter bindings, verbs and routes and test client proxy for it! + + private readonly IRegularTestController _controller; + + public RegularTestControllerClientProxy_Tests() + { + _controller = ServiceProvider.GetRequiredService(); + } + + [Fact] + public void IncrementValue() + { + _controller.IncrementValue(42).ShouldBe(43); + } + } +} \ No newline at end of file