mirror of https://github.com/abpframework/abp.git
5 changed files with 58 additions and 8 deletions
@ -0,0 +1,7 @@ |
|||||
|
namespace Volo.Abp.Http.DynamicProxying |
||||
|
{ |
||||
|
public interface IRegularTestController |
||||
|
{ |
||||
|
int IncrementValue(int value); |
||||
|
} |
||||
|
} |
||||
@ -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!
|
|
||||
} |
|
||||
} |
|
||||
@ -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; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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<IRegularTestController>(); |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public void IncrementValue() |
||||
|
{ |
||||
|
_controller.IncrementValue(42).ShouldBe(43); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue