Use OneTimeRunner and clear the test code.

pull/5062/head
Halil İbrahim Kalkan 5 years ago
parent 092093f8bb
commit 838289552e

@ -1,12 +1,18 @@
using Volo.Abp.GlobalFeatures;
using Volo.Abp.Threading;
namespace Volo.CmsKit
{
public static class FeatureConfigurer
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
GlobalFeatureManager.Instance.Modules.CmsKit().EnableAll();
});
}
}
}

@ -5,7 +5,7 @@ using Volo.CmsKit.GlobalFeatures;
namespace Volo.Abp.GlobalFeatures
{
public static class GlobalFeatureManagerModuleConfiguratorCmsKitExtensions
public static class GlobalModuleFeaturesDictionaryCmsKitExtensions
{
public static GlobalCmsKitFeatures CmsKit(
[NotNull] this GlobalModuleFeaturesDictionary modules)

@ -1,12 +1,10 @@
using Volo.Abp.GlobalFeatures;
using Volo.Abp.Modularity;
using Volo.Abp.Modularity;
using Volo.Abp.Localization;
using Volo.CmsKit.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Validation;
using Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;
using Volo.CmsKit.GlobalFeatures;
namespace Volo.CmsKit
{
@ -17,19 +15,6 @@ namespace Volo.CmsKit
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
GlobalFeatureManager.Instance.Modules.CmsKit().EnableAll();
GlobalFeatureManager.Instance.Modules.CmsKit().DisableAll();
GlobalFeatureManager.Instance.Modules.CmsKit().Reactions.Enable();
GlobalFeatureManager.Instance.Modules.CmsKit().Reactions.Enable();
GlobalFeatureManager.Instance.Modules.CmsKit(cmsKit =>
{
cmsKit.Reactions.Disable();
cmsKit.Comments.Enable();
});
GlobalFeatureManager.Instance.IsEnabled("qweasd");
GlobalFeatureManager.Instance.IsEnabled<ReactionsFeature>();
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<CmsKitDomainSharedModule>();

@ -8,6 +8,7 @@ namespace Volo.CmsKit.GlobalFeatures
public const string ModuleName = "CmsKit";
public ReactionsFeature Reactions => GetFeature<ReactionsFeature>();
public CommentsFeature Comments => GetFeature<CommentsFeature>();
public GlobalCmsKitFeatures([NotNull] GlobalFeatureManager featureManager)

@ -17,9 +17,14 @@ namespace Volo.CmsKit
)]
public class CmsKitTestBaseModule : AbpModule
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public override void ConfigureServices(ServiceConfigurationContext context)
{
OneTimeRunner.Run(() =>
{
GlobalFeatureManager.Instance.Modules.CmsKit().EnableAll();
});
context.Services.AddAlwaysAllowAuthorization();
}

Loading…
Cancel
Save