Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
954 B

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)
{
}
}
}
}