diff --git a/src/AbpHelper.Core/Steps/Abp/ModificationCreatorSteps/CSharp/MenuContributorStep.cs b/src/AbpHelper.Core/Steps/Abp/ModificationCreatorSteps/CSharp/MenuContributorStep.cs index 6d480063..1a5f5231 100644 --- a/src/AbpHelper.Core/Steps/Abp/ModificationCreatorSteps/CSharp/MenuContributorStep.cs +++ b/src/AbpHelper.Core/Steps/Abp/ModificationCreatorSteps/CSharp/MenuContributorStep.cs @@ -28,6 +28,7 @@ CSharpSyntaxNode MainMenu(CSharpSyntaxNode root) => root.Descendants( @@ -35,6 +36,18 @@ CSharpSyntaxNode MainMenu(CSharpSyntaxNode root) => root.Descendants root.NotContains(usingForAppText) )); + builders.Add( + new ReplacementBuilder( + root => MainMenu(root).GetStartLine(), + root => MainMenu(root).GetStartLine(), + configureMainMenuText, + modifyCondition: root => root.NotContains(configureMainMenuText) + )); + builders.Add(new DeletionBuilder( + root => MainMenu(root).GetEndLine() - 1, + root => MainMenu(root).GetEndLine() - 1, + modifyCondition: root => !root.NotContains("return Task.CompletedTask;") + )); builders.Add( new InsertionBuilder( root => MainMenu(root).GetEndLine(), diff --git a/src/AbpHelper.Core/Templates/Crud/Groups/Test/test/{{ProjectInfo.FullName}}.Application.Tests/{{EntityInfo.RelativeDirectory}}/{{EntityInfo.Name}}AppServiceTests.cs b/src/AbpHelper.Core/Templates/Crud/Groups/Test/test/{{ProjectInfo.FullName}}.Application.Tests/{{EntityInfo.RelativeDirectory}}/{{EntityInfo.Name}}AppServiceTests.cs index b582208a..df947936 100644 --- a/src/AbpHelper.Core/Templates/Crud/Groups/Test/test/{{ProjectInfo.FullName}}.Application.Tests/{{EntityInfo.RelativeDirectory}}/{{EntityInfo.Name}}AppServiceTests.cs +++ b/src/AbpHelper.Core/Templates/Crud/Groups/Test/test/{{ProjectInfo.FullName}}.Application.Tests/{{EntityInfo.RelativeDirectory}}/{{EntityInfo.Name}}AppServiceTests.cs @@ -1,10 +1,12 @@ using Shouldly; using System.Threading.Tasks; +using Volo.Abp.Modularity; using Xunit; namespace {{ EntityInfo.Namespace }}; -public class {{ EntityInfo.Name }}AppServiceTests : {{ ProjectInfo.Name }}ApplicationTestBase +public abstract class {{ EntityInfo.Name }}AppServiceTests : {{ ProjectInfo.Name }}ApplicationTestBase + where TStartupModule : IAbpModule { private readonly I{{ EntityInfo.Name }}AppService _{{ EntityInfo.Name | abp.camel_case }}AppService; diff --git a/src/AbpHelper.Core/Templates/Crud/Groups/Test/test/{{ProjectInfo.FullName}}.Domain.Tests/{{EntityInfo.RelativeDirectory}}/{{EntityInfo.Name}}DomainTests.cs b/src/AbpHelper.Core/Templates/Crud/Groups/Test/test/{{ProjectInfo.FullName}}.Domain.Tests/{{EntityInfo.RelativeDirectory}}/{{EntityInfo.Name}}DomainTests.cs index 455ff3cc..318bd892 100644 --- a/src/AbpHelper.Core/Templates/Crud/Groups/Test/test/{{ProjectInfo.FullName}}.Domain.Tests/{{EntityInfo.RelativeDirectory}}/{{EntityInfo.Name}}DomainTests.cs +++ b/src/AbpHelper.Core/Templates/Crud/Groups/Test/test/{{ProjectInfo.FullName}}.Domain.Tests/{{EntityInfo.RelativeDirectory}}/{{EntityInfo.Name}}DomainTests.cs @@ -1,10 +1,12 @@ using System.Threading.Tasks; using Shouldly; +using Volo.Abp.Modularity; using Xunit; namespace {{ EntityInfo.Namespace }}; -public class {{ EntityInfo.Name }}DomainTests : {{ ProjectInfo.Name }}DomainTestBase +public abstract class {{ EntityInfo.Name }}DomainTests : {{ ProjectInfo.Name }}TestBase + where TStartupModule : IAbpModule { public {{ EntityInfo.Name }}DomainTests() { diff --git a/src/AbpHelper.Core/Workflow/Generate/Crud/MigrationAndUpdateDatabaseWorkflow.cs b/src/AbpHelper.Core/Workflow/Generate/Crud/MigrationAndUpdateDatabaseWorkflow.cs index f7ed6daa..2eb0f36c 100644 --- a/src/AbpHelper.Core/Workflow/Generate/Crud/MigrationAndUpdateDatabaseWorkflow.cs +++ b/src/AbpHelper.Core/Workflow/Generate/Crud/MigrationAndUpdateDatabaseWorkflow.cs @@ -14,11 +14,11 @@ public static IActivityBuilder AddMigrationAndUpdateDatabaseWorkflow(this IOutco .AddConfigureMigrationProjectsWorkflow(ActivityNames.AddMigration) /* Add migration */ .Then( - step => step.Command = new JavaScriptExpression("`dotnet ef migrations add Added${EntityInfo.Name} -p \"${MigrationProjectFile}\" -s \"${StartupProjectFile}\"`") + step => step.Command = new JavaScriptExpression("`dotnet ef migrations add Added${EntityInfo.Name} -p \"${MigrationProjectFile}\"`") ).WithName(ActivityNames.AddMigration) /* Update database */ .Then( - step => step.Command = new JavaScriptExpression("`dotnet ef database update -p \"${MigrationProjectFile}\" -s \"${StartupProjectFile}\"`") + step => step.Command = new JavaScriptExpression("`dotnet ef database update -p \"${MigrationProjectFile}\"`") ) ; }