mirror of https://github.com/abpframework/abp.git
3 changed files with 62 additions and 6 deletions
@ -0,0 +1,30 @@ |
|||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Shouldly; |
||||
|
using Volo.Abp.Modularity; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace Volo.Abp.Tests.Modularity |
||||
|
{ |
||||
|
public class ModuleLoader_Tests |
||||
|
{ |
||||
|
[Fact] |
||||
|
public void Should_Load_Modules_By_Dependency_Order() |
||||
|
{ |
||||
|
var moduleLoader = new ModuleLoader(); |
||||
|
moduleLoader.LoadAll(new ServiceCollection(), typeof(MyStartupModule)); |
||||
|
moduleLoader.Modules.Count.ShouldBe(3); |
||||
|
moduleLoader.Modules[0].Type.ShouldBe(typeof(AbpKernelModule)); |
||||
|
moduleLoader.Modules[1].Type.ShouldBe(typeof(IndependentEmptyModule)); |
||||
|
moduleLoader.Modules[2].Type.ShouldBe(typeof(MyStartupModule)); |
||||
|
} |
||||
|
|
||||
|
[DependsOn(typeof(IndependentEmptyModule))] |
||||
|
public class MyStartupModule : IAbpModule |
||||
|
{ |
||||
|
public void ConfigureServices(IServiceCollection services) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue