mirror of https://github.com/abpframework/abp.git
11 changed files with 157 additions and 11 deletions
@ -0,0 +1,22 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.Http</AssemblyName> |
|||
<PackageId>Volo.Abp.Http</PackageId> |
|||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp\Volo.Abp.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Folder Include="Volo\Abp\Http\DynamicProxying\Oas\" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.Http |
|||
{ |
|||
public class AbpHttpModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddAssemblyOf<AbpHttpModule>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netcoreapp2.0</TargetFramework> |
|||
<AssemblyName>Volo.Abp.Http.Tests</AssemblyName> |
|||
<PackageId>Volo.Abp.Http.Tests</PackageId> |
|||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> |
|||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> |
|||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> |
|||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\Volo.Abp.Http\Volo.Abp.Http.csproj" /> |
|||
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.Tests\Volo.Abp.AspNetCore.Mvc.Tests.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,9 @@ |
|||
using Volo.Abp.AspNetCore.App; |
|||
|
|||
namespace Volo.Abp.Http |
|||
{ |
|||
public abstract class AbpHttpTestBase : AbpAspNetCoreTestBase<Startup> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.AspNetCore.App; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.Http |
|||
{ |
|||
[DependsOn(typeof(AbpAspNetCoreMvcTestModule), typeof(AbpHttpModule))] |
|||
public class AbpHttpTestModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddAssemblyOf<AbpAspNetCoreMvcTestModule>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Shouldly; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.TestApp.Application; |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.Http.DynamicProxying |
|||
{ |
|||
public class PersonAppServiceClientProxy_Tests : AbpHttpTestBase |
|||
{ |
|||
private readonly IPeopleAppService _peopleAppService; |
|||
|
|||
public PersonAppServiceClientProxy_Tests() |
|||
{ |
|||
//TODO: Should actually test the proxy!
|
|||
_peopleAppService = ServiceProvider.GetRequiredService<IPeopleAppService>(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Test_GetList() |
|||
{ |
|||
var people = await _peopleAppService.GetList(new PagedAndSortedResultRequestDto()); |
|||
people.TotalCount.ShouldBeGreaterThan(0); |
|||
people.Items.Count.ShouldBe(people.TotalCount); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
using System; |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Hosting; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
namespace Volo.Abp.Http |
|||
{ |
|||
public class Startup |
|||
{ |
|||
public IServiceProvider ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddApplication<AbpHttpTestModule>(options => |
|||
{ |
|||
options.UseAutofac(); |
|||
}); |
|||
|
|||
//TODO: This is needed because ASP.NET Core does not use IServiceProviderFactory!
|
|||
return services.BuildServiceProviderFromFactory(); |
|||
} |
|||
|
|||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) |
|||
{ |
|||
app.InitializeApplication(); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue