mirror of https://github.com/abpframework/abp.git
13 changed files with 110 additions and 17 deletions
@ -0,0 +1,9 @@ |
|||
using Volo.Abp.AspNetCore.App; |
|||
|
|||
namespace Volo.Abp.AspNetCore.MultiTenancy |
|||
{ |
|||
public abstract class AspNetCoreMultiTenancyTestBase : AbpAspNetCoreTestBase<Startup> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.AspNetCore.Modularity; |
|||
using Volo.Abp.AspNetCore.TestBase; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.App |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAspNetCoreTestBaseModule) |
|||
)] |
|||
public class AppModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddMvc(); |
|||
} |
|||
|
|||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|||
{ |
|||
var app = context.GetApplicationBuilder(); |
|||
app.UseMvcWithDefaultRoute(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
|
|||
namespace Volo.Abp.AspNetCore.App |
|||
{ |
|||
public class SimpleController : AbpController |
|||
{ |
|||
public ActionResult Index() |
|||
{ |
|||
return Content("Index-Result"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Hosting; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
namespace Volo.Abp.AspNetCore.App |
|||
{ |
|||
public class Startup |
|||
{ |
|||
public void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddApplication<AppModule>(); |
|||
} |
|||
|
|||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) |
|||
{ |
|||
app.InitializeApplication(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using Volo.Abp.AspNetCore.App; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc |
|||
{ |
|||
public abstract class AspNetCoreMvcTestBase : AbpAspNetCoreTestBase<Startup> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using System.Threading.Tasks; |
|||
using Shouldly; |
|||
using Volo.Abp.AspNetCore.App; |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc |
|||
{ |
|||
public class SimpleController_Tests : AspNetCoreMvcTestBase |
|||
{ |
|||
[Fact] |
|||
public async Task ActionResult_Return_Type_ContentResult_Return_Value() |
|||
{ |
|||
var result = await GetResponseAsStringAsync( |
|||
GetUrl<SimpleController>(nameof(SimpleController.Index)) |
|||
); |
|||
|
|||
result.ShouldBe("Index-Result"); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue