diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index 8da2082360..2261ab7bab 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -2,7 +2,7 @@ blank_issues_enabled: true
contact_links:
- name: Issue with ABP Commercial
url: https://support.abp.io/QA/Questions
- about: Please open issues relating to ABP Commercial in support.abp.io.
+ about: Please open ABP Commercial related issues at https://support.abp.io.
- name: Ask a question (community support)
url: https://stackoverflow.com/questions/tagged/abp
about: Ask a question that will be answered by the ABP community
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json
index a262cbb093..16ab51f750 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Base/Localization/Resources/en.json
@@ -240,6 +240,12 @@
"MeetTheABPCommunity": "Meet the ABP ",
"DisplayName:CommunityIndexPagePoll": "Community Index Page Poll",
"ReturnOfInvestment": "Return Of Investment",
+ "PromotionalOffers": "Promotional Offers",
+ "PromotionalOffersDefinition": "Discounts, seasonal campaigns, etc.",
+ "EventsDefinition": "Community Talks, Webinars, ABP .NET Conference, etc.",
+ "ReleaseNotesDefinition": "ABP.IO Platform releases, new products, etc.",
+ "Newsletter": "Newsletter",
+ "NewsletterDefinition": "Blog posts, community news, etc.",
"EmailPreferences": "Email Preferences",
"DoYouAgreePrivacyPolicy": "By clicking Subscribe button you agree to the Terms & Conditions and Privacy Policy."
}
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
index 0c4448e8a9..f84dcb0c9c 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
@@ -1181,6 +1181,7 @@
"LearnMore": "Learn More",
"ReturnOfInvestment": "Return of Investment",
"ReturnOfInvestment_Description": "Learn how to reduce your development costs by more than %50.",
+ "SpecialDiscount": "Special Discount",
"Previous": "Previous"
}
}
\ No newline at end of file
diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/tr.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/tr.json
index 11884275b4..71119725b9 100644
--- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/tr.json
+++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/tr.json
@@ -615,7 +615,7 @@
"TotalDeveloperPrice": "Toplam Geliştirici Fiyatı",
"Purchase_PricePerDeveloper": "{0} geliştirici başına",
"Purchase_IncludedDeveloperInfo": "{0} {1} dahil.",
- "Purchase_LicenseExtraDeveloperPurchaseMessage": "{0} lisansı {1} geliştirici(ler) içerir. Şimdi veya daha sonra ek geliştiriciler ekleyebilirsiniz.",
+ "Purchase_LicenseExtraDeveloperPurchaseMessage": "{0} lisansı {1} geliştirici içerir. Şimdi veya daha sonra ek geliştirici ekleyebilirsiniz.",
"StartupTemplates_Page_Title": "ABP Başlangıç Şablonları",
"StartupTemplates_Page_Description": "ABP Commercial, her düzeyde karmaşıklığa sahip projeler oluşturmanıza olanak tanır. Önceden oluşturulmuş iki ana başlangıç projesi sunar. Gereksinimlerinize yakın olanı seçebilir ve bunun üzerine kendi özel projenizi oluşturabilirsiniz.",
"MicroserviceStartupSolutionForDotnet": ".NET için Mikroservis Başlatma Projesi",
diff --git a/docs/en/API/Static-CSharp-API-Clients.md b/docs/en/API/Static-CSharp-API-Clients.md
index 85ffb3e213..5bcbc252c7 100644
--- a/docs/en/API/Static-CSharp-API-Clients.md
+++ b/docs/en/API/Static-CSharp-API-Clients.md
@@ -65,8 +65,9 @@ Now, it's ready to configure the application for the static client proxy generat
````csharp
[DependsOn(
- typeof(AbpHttpClientModule) //used to create client proxies
- )]
+ typeof(AbpHttpClientModule), //used to create client proxies
+ typeof(AbpVirtualFileSystemModule) //virtual file system
+)]
public class MyClientAppModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
@@ -75,6 +76,12 @@ public class MyClientAppModule : AbpModule
context.Services.AddStaticHttpClientProxies(
typeof(MyClientAppModule).Assembly
);
+
+ // Include the generated app-generate-proxy.json in the virtual file system
+ Configure(options =>
+ {
+ options.FileSets.AddEmbedded();
+ });
}
}
````
@@ -84,8 +91,9 @@ public class MyClientAppModule : AbpModule
````csharp
[DependsOn(
typeof(AbpHttpClientModule), //used to create client proxies
+ typeof(AbpVirtualFileSystemModule), //virtual file system
typeof(BookStoreApplicationContractsModule) //contains the application service interfaces
- )]
+)]
public class MyClientAppModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
@@ -94,6 +102,12 @@ public class MyClientAppModule : AbpModule
context.Services.AddStaticHttpClientProxies(
typeof(BookStoreApplicationContractsModule).Assembly
);
+
+ // Include the generated app-generate-proxy.json in the virtual file system
+ Configure(options =>
+ {
+ options.FileSets.AddEmbedded();
+ });
}
}
````
@@ -139,7 +153,7 @@ This command should generate the following files under the `ClientProxies` folde
* `BookClientProxy.Generated.cs` is the actual generated proxy class in this example. `BookClientProxy` is a `partial` class * where you can write your custom code (ABP won't override it).
* `IBookAppService.cs` is the app service.
* `BookDto.cs` is the Dto class which uses by app service.
-* `app-generate-proxy.json` contains information about the remote HTTP endpoint, so ABP can properly perform HTTP requests.
+* `app-generate-proxy.json` contains information about the remote HTTP endpoint, so ABP can properly perform HTTP requests. This file must be configured as an embedded resource in your project, so that it can be found by the virtual file system.
#### Without Contracts
@@ -152,7 +166,7 @@ This command should generate the following files under the `ClientProxies` folde

* `BookClientProxy.Generated.cs` is the actual generated proxy class in this example. `BookClientProxy` is a `partial` class where you can write your custom code (ABP won't override it).
-* `app-generate-proxy.json` contains information about the remote HTTP endpoint, so ABP can properly perform HTTP requests.
+* `app-generate-proxy.json` contains information about the remote HTTP endpoint, so ABP can properly perform HTTP requests. This file must be configured as an embedded resource in your project, so that it can be found by the virtual file system.
> `generate-proxy` command generates proxies for only the APIs you've defined in your application. If you are developing a modular application, you can specify the `-m` (or `--module`) parameter to specify the module you want to generate proxies. See the *generate-proxy* section in the [ABP CLI](../CLI.md) documentation for other options.
diff --git a/docs/en/Modules/Tenant-Management.md b/docs/en/Modules/Tenant-Management.md
index 0d43c5e31e..6245db82c8 100644
--- a/docs/en/Modules/Tenant-Management.md
+++ b/docs/en/Modules/Tenant-Management.md
@@ -56,7 +56,7 @@ This module defines the following ETOs (Event Transfer Objects) to allow you to
**Example: Get notified when a new tenant has been created**
-```
+```cs
public class MyHandler :
IDistributedEventHandler>,
ITransientDependency
@@ -131,4 +131,4 @@ ABP Framework allows to use *database per tenant* approach that allows a tenant
## See Also
* [Multi-Tenancy](../Multi-Tenancy.md)
-* [ABP Commercial SaaS Module](https://docs.abp.io/en/commercial/latest/modules/saas)
\ No newline at end of file
+* [ABP Commercial SaaS Module](https://docs.abp.io/en/commercial/latest/modules/saas)
diff --git a/docs/en/Testing.md b/docs/en/Testing.md
index fe005756ca..e58defc619 100644
--- a/docs/en/Testing.md
+++ b/docs/en/Testing.md
@@ -36,7 +36,7 @@ There are more than one test project, organized by the layers;
* `Domain.Tests` is used to test your Domain Layer objects (like [Domain Services](Domain-Services.md) and [Entities](Entities.md)).
* `Application.Tests` is used to test your Application Layer (like [Application Services](Application-Services.md)).
-* `EntityFrameworkCore.Tests` is used to test your custom repository implementations or EF Core mappings (this project will be different if you use another [Database Provider](Data-Access.md)).
+* `EntityFrameworkCore.Tests` is used to implement abstract test classes and test your custom repository implementations or EF Core mappings (this project will be different if you use another [Database Provider](Data-Access.md)).
* `Web.Tests` is used to test the UI Layer (like Pages, Controllers and View Components). This project does exists only for MVC / Razor Page applications.
* `TestBase` contains some classes those are shared/used by the other projects.
@@ -537,12 +537,13 @@ using Xunit;
namespace MyProject.Issues
{
- public class IssueManager_Integration_Tests : MyProjectDomainTestBase
+ public abstract class IssueManager_Integration_Tests : MyProjectDomainTestBase
+ where TStartupModule : IAbpModule
{
private readonly IssueManager _issueManager;
private readonly Issue _issue;
- public IssueManager_Integration_Tests()
+ protected IssueManager_Integration_Tests()
{
_issueManager = GetRequiredService();
_issue = new Issue
@@ -577,6 +578,8 @@ namespace MyProject.Issues
}
````
+> The `IssueManager_Integration_Tests` class is an abstract class, and tests in this class are not seen on the tests explorer, see the **Implementing unit tests in EF Core and MongoDB** section below to learn how to list tests in the test explorer and run them.
+
* First test method assigns the issue to the User 1, which has already assigned to 3 issues in the Data Seed code. So, it throws a `BusinessException`.
* Second test method assigns the issue to User 2, which has only 1 issue assigned. So, the method succeeds.
@@ -625,11 +628,12 @@ using Xunit;
namespace MyProject.Issues
{
- public class IssueAppService_Tests : MyProjectApplicationTestBase
+ public abstract class IssueAppService_Tests : MyProjectApplicationTestBase
+ where TStartupModule : IAbpModule
{
private readonly IIssueAppService _issueAppService;
- public IssueAppService_Tests()
+ protected IssueAppService_Tests()
{
_issueAppService = GetRequiredService();
}
@@ -647,6 +651,8 @@ namespace MyProject.Issues
}
````
+> The `IssueAppService_Tests` class is an abstract, and tests in this class are not seen on the tests explorer, see the **Implementing unit tests in EF Core and MongoDB** section below to learn how to list tests in the test explorer and run them.
+
It's that simple. This test method tests everything, including the application service, EF Core mapping, object to object mapping and the repository implementation. In this way, you can fully test the Application Layer and the Domain Layer of your solution.
### Dealing with Unit of Work in Integration Tests
@@ -658,11 +664,12 @@ In the ABP Framework, all the database operations must be performed inside a uni
In some cases, you may need to manually control the unit of work scope. Consider the following test method:
````csharp
-public class IssueRepository_Tests : MyProjectDomainTestBase
+public abstract class IssueRepository_Tests : MyProjectDomainTestBase
+ where TStartupModule : IAbpModule
{
private readonly IRepository _issueRepository;
- public IssueRepository_Tests()
+ protected IssueRepository_Tests()
{
_issueRepository = GetRequiredService>();
}
@@ -676,17 +683,20 @@ public class IssueRepository_Tests : MyProjectDomainTestBase
}
````
+> The `IssueRepository_Tests` class is an abstract, and tests in this class are not seen on the tests explorer, see the **Implementing unit tests in EF Core and MongoDB** section below to learn how to list tests in the test explorer and run them.
+
We are using `_issueRepository.GetQueryableAsync` to obtain an `IQueryable` object. Then, we are using the `FirstOrDefaultAsync` method to query an issue by its title. The database query is executed at this point, and you get an exception indicating that there is no active unit of work.
To make that test properly working, you should manually start a unit of work scope as shown in the following example:
````csharp
-public class IssueRepository_Tests : MyProjectDomainTestBase
+public abstract class IssueRepository_Tests : MyProjectDomainTestBase
+ where TStartupModule : IAbpModule
{
private readonly IRepository _issueRepository;
private readonly IUnitOfWorkManager _unitOfWorkManager;
- public IssueRepository_Tests()
+ protected IssueRepository_Tests()
{
_issueRepository = GetRequiredService>();
_unitOfWorkManager = GetRequiredService();
@@ -716,12 +726,13 @@ In some cases, you may want to directory work with the Entity Framework's `DbCon
The following example shows how you can create a `DbContext` object in a test method:
````csharp
-public class MyDbContext_Tests : MyProjectDomainTestBase
+public abstract class MyDbContext_Tests : MyProjectDomainTestBase
+ where TStartupModule : IAbpModule
{
private readonly IDbContextProvider _dbContextProvider;
private readonly IUnitOfWorkManager _unitOfWorkManager;
- public IssueRepository_Tests()
+ protected IssueRepository_Tests()
{
_dbContextProvider = GetRequiredService>();
_unitOfWorkManager = GetRequiredService();
@@ -740,10 +751,33 @@ public class MyDbContext_Tests : MyProjectDomainTestBase
}
````
+> The `MyDbContext_Tests` class is an abstract, and tests in this class are not seen on the tests explorer, see the **Implementing unit tests in EF Core and MongoDB** section below to learn how to list tests in the test explorer and run them.
+
Just like we've done in the *Dealing with Unit of Work in Integration Tests* section, we should perform `DbContext` operations inside an active unit of work.
For [MongoDB](MongoDB.md), you can use the `IMongoDbContextProvider` service to obtain a `DbContext` object and directly use MongoDB APIs in your test methods.
+## Implementing unit tests in EF Core and MongoDB
+
+The unit test classes in the `.Domain.Test` and `.Application.Tests` projects are all abstract classes. Therefore, we need to implement the test classes in EF Core or MongoDB test projects to run the tests, otherwise they will be ignored.
+
+An example implementation for the `IssueManager_Integration_Tests` class in the `.EntityFrameworkCore.Tests` project is shown below:
+
+````csharp
+namespace MyProject.EntityFrameworkCore.Applications;
+
+public class EfCoreIssueAppService_Tests : IssueAppService_Tests
+{
+
+}
+````
+
+> By deriving from the related abstract classes, now we can see the all tests in the test explorers and run them.
+
+
+
+As you can see from the folder structure, all tests are clearly placed into the related subfolders, and they will be seen in the test explorer with this separation. Thus, you can clearly see which tests are related to which layers and projects.
+
## UI Tests
In general, there are two types of UI Tests;
diff --git a/docs/en/images/solution-test-projects.png b/docs/en/images/solution-test-projects.png
index e51c368e9f..87ac41c6a1 100644
Binary files a/docs/en/images/solution-test-projects.png and b/docs/en/images/solution-test-projects.png differ
diff --git a/docs/en/images/unitest-efcore-mongodb.png b/docs/en/images/unitest-efcore-mongodb.png
new file mode 100644
index 0000000000..4145d9d7c9
Binary files /dev/null and b/docs/en/images/unitest-efcore-mongodb.png differ
diff --git a/docs/en/images/vs-run-tests-in-parallel.png b/docs/en/images/vs-run-tests-in-parallel.png
index 765cba5100..cb33bd76c2 100644
Binary files a/docs/en/images/vs-run-tests-in-parallel.png and b/docs/en/images/vs-run-tests-in-parallel.png differ
diff --git a/docs/en/images/vs-startup-template-tests.png b/docs/en/images/vs-startup-template-tests.png
index f16d79a4c7..0e45200e13 100644
Binary files a/docs/en/images/vs-startup-template-tests.png and b/docs/en/images/vs-startup-template-tests.png differ
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs
index 37343b72ed..e9cbd0a997 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/AbpInputTagHelperService.cs
@@ -54,19 +54,22 @@ public class AbpInputTagHelperService : AbpTagHelperService
output.TagMode = TagMode.StartTagAndEndTag;
output.TagName = "div";
LeaveOnlyGroupAttributes(context, output);
- if (TagHelper.FloatingLabel && !isCheckBox)
+ if (!IsOutputHidden(output))
{
- output.Attributes.AddClass("form-floating");
- }
- if (TagHelper.AddMarginBottomClass)
- {
- output.Attributes.AddClass(isCheckBox ? "mb-2" : "mb-3");
- }
- if (isCheckBox)
- {
- output.Attributes.AddClass("custom-checkbox");
- output.Attributes.AddClass("custom-control");
- output.Attributes.AddClass("form-check");
+ if (TagHelper.FloatingLabel && !isCheckBox)
+ {
+ output.Attributes.AddClass("form-floating");
+ }
+ if (TagHelper.AddMarginBottomClass)
+ {
+ output.Attributes.AddClass(isCheckBox ? "mb-2" : "mb-3");
+ }
+ if (isCheckBox)
+ {
+ output.Attributes.AddClass("custom-checkbox");
+ output.Attributes.AddClass("custom-control");
+ output.Attributes.AddClass("form-check");
+ }
}
output.Content.AppendHtml(innerHtml);
}
@@ -263,7 +266,7 @@ public class AbpInputTagHelperService : AbpTagHelperService
}
protected virtual async Task GetLabelAsHtmlAsync(TagHelperContext context, TagHelperOutput output, TagHelperOutput inputTag, bool isCheckbox)
- {
+ {
if (IsOutputHidden(inputTag) || TagHelper.SuppressLabel)
{
return string.Empty;
diff --git a/framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo/Abp/EntityFrameworkCore/Sqlite/AbpUnitTestSqliteConnection.cs b/framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo/Abp/EntityFrameworkCore/Sqlite/AbpUnitTestSqliteConnection.cs
new file mode 100644
index 0000000000..e3b0dd7e30
--- /dev/null
+++ b/framework/src/Volo.Abp.EntityFrameworkCore.Sqlite/Volo/Abp/EntityFrameworkCore/Sqlite/AbpUnitTestSqliteConnection.cs
@@ -0,0 +1,52 @@
+using System.Threading;
+using Microsoft.Data.Sqlite;
+using Volo.Abp.Threading;
+
+namespace Volo.Abp.EntityFrameworkCore.Sqlite;
+
+///
+/// This class is for unit testing purposes.
+/// It prevents exceptions in concurrent testing because Sqlite is not thread-safe.
+///
+public class AbpUnitTestSqliteConnection : SqliteConnection
+{
+ public AbpUnitTestSqliteConnection(string connectionString)
+ : base(connectionString)
+ {
+ }
+
+ public override SqliteCommand CreateCommand()
+ {
+ return new AbpSqliteCommand
+ {
+ Connection = this,
+ CommandTimeout = DefaultTimeout,
+ Transaction = Transaction
+ };
+ }
+}
+
+internal class AbpSqliteCommand : SqliteCommand
+{
+ private readonly static SemaphoreSlim Semaphore = new SemaphoreSlim(1, 1);
+
+ public override SqliteConnection? Connection
+ {
+ get => base.Connection;
+ set
+ {
+ using (Semaphore.Lock())
+ {
+ base.Connection = value;
+ }
+ }
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ using (Semaphore.Lock())
+ {
+ base.Dispose(disposing);
+ }
+ }
+}
diff --git a/framework/src/Volo.Abp.Json.SystemTextJson/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs b/framework/src/Volo.Abp.Json.SystemTextJson/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs
index 9b20a4aa09..ac6208f47b 100644
--- a/framework/src/Volo.Abp.Json.SystemTextJson/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs
+++ b/framework/src/Volo.Abp.Json.SystemTextJson/Volo/Abp/Json/SystemTextJson/JsonConverters/AbpStringToEnumConverter.cs
@@ -11,6 +11,8 @@ public class AbpStringToEnumConverter : JsonConverter
private JsonSerializerOptions? _readJsonSerializerOptions;
+ private JsonSerializerOptions? _writeJsonSerializerOptions;
+
public AbpStringToEnumConverter()
: this(namingPolicy: null, allowIntegerValues: true)
{
@@ -39,7 +41,11 @@ public class AbpStringToEnumConverter : JsonConverter
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
{
- JsonSerializer.Serialize(writer, value);
+ _writeJsonSerializerOptions ??= JsonSerializerOptionsHelper.Create(options, x =>
+ x == this ||
+ x.GetType() == typeof(AbpStringToEnumFactory));
+
+ JsonSerializer.Serialize(writer, value, _writeJsonSerializerOptions);
}
public override T ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
diff --git a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AbpAuditingTestModule.cs b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AbpAuditingTestModule.cs
index 3a21cfaf5a..c753d65d07 100644
--- a/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AbpAuditingTestModule.cs
+++ b/framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/AbpAuditingTestModule.cs
@@ -62,7 +62,7 @@ public class AbpAuditingTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
using (var context = new AbpAuditingTestDbContext(new DbContextOptionsBuilder()
diff --git a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreTestModule.cs b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreTestModule.cs
index f23ac14fda..7db3130827 100644
--- a/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreTestModule.cs
+++ b/framework/test/Volo.Abp.EntityFrameworkCore.Tests/Volo/Abp/EntityFrameworkCore/AbpEntityFrameworkCoreTestModule.cs
@@ -93,7 +93,7 @@ public class AbpEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
using (var context = new TestMigrationsDbContext(new DbContextOptionsBuilder().UseSqlite(connection).Options))
diff --git a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs
index 8d00afd109..3996ddafe5 100644
--- a/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs
+++ b/framework/test/Volo.Abp.Json.Tests/Volo/Abp/Json/AbpStringToEnum_Tests.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
+using System.Text.Json.Serialization;
using Shouldly;
using Volo.Abp.Json.SystemTextJson.JsonConverters;
using Xunit;
@@ -53,10 +54,26 @@ public class AbpStringToEnum_Tests
var testClassJson = JsonSerializer.Serialize(new TestClass()
{
Day = DayOfWeek.Monday
- });
+ }, options);
testClassJson.ShouldBe("{\"Day\":1}");
+ options = new JsonSerializerOptions()
+ {
+ Converters =
+ {
+ new AbpStringToEnumFactory(),
+ new JsonStringEnumConverter()
+ }
+ };
+
+ testClassJson = JsonSerializer.Serialize(new TestClass()
+ {
+ Day = DayOfWeek.Monday
+ }, options);
+
+ testClassJson.ShouldBe("{\"Day\":\"Monday\"}");
+
testClassJson = JsonSerializer.Serialize(new Dictionary
{
{DayOfWeek.Monday, "Mo"}
diff --git a/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs b/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs
index c262c6a4cb..14f3554a14 100644
--- a/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs
+++ b/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs
@@ -33,7 +33,7 @@ public class AccountController : AbpControllerBase, IAccountAppService
[HttpPost]
[Route("verify-password-reset-token")]
- public Task VerifyPasswordResetTokenAsync(VerifyPasswordResetTokenInput input)
+ public virtual Task VerifyPasswordResetTokenAsync(VerifyPasswordResetTokenInput input)
{
return AccountAppService.VerifyPasswordResetTokenAsync(input);
}
diff --git a/modules/account/test/Volo.Abp.Account.Application.Tests/Volo/Abp/Account/AbpAccountApplicationTestModule.cs b/modules/account/test/Volo.Abp.Account.Application.Tests/Volo/Abp/Account/AbpAccountApplicationTestModule.cs
index 100087f1fb..2a6c932753 100644
--- a/modules/account/test/Volo.Abp.Account.Application.Tests/Volo/Abp/Account/AbpAccountApplicationTestModule.cs
+++ b/modules/account/test/Volo.Abp.Account.Application.Tests/Volo/Abp/Account/AbpAccountApplicationTestModule.cs
@@ -44,7 +44,7 @@ public class AbpAccountApplicationTestModule : AbpModule
}
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new IdentityDbContext(
diff --git a/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingEntityFrameworkCoreTestModule.cs b/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingEntityFrameworkCoreTestModule.cs
index bb8570d253..42d246625e 100644
--- a/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingEntityFrameworkCoreTestModule.cs
+++ b/modules/audit-logging/test/Volo.Abp.AuditLogging.EntityFrameworkCore.Tests/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingEntityFrameworkCoreTestModule.cs
@@ -31,7 +31,7 @@ public class AbpAuditLoggingEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new AbpAuditLoggingDbContext(
diff --git a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo/Abp/BackgroundJobs/EntityFrameworkCore/AbpBackgroundJobsEntityFrameworkCoreTestModule.cs b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo/Abp/BackgroundJobs/EntityFrameworkCore/AbpBackgroundJobsEntityFrameworkCoreTestModule.cs
index a642ddc227..c19016d0d0 100644
--- a/modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo/Abp/BackgroundJobs/EntityFrameworkCore/AbpBackgroundJobsEntityFrameworkCoreTestModule.cs
+++ b/modules/background-jobs/test/Volo.Abp.BackgroundJobs.EntityFrameworkCore.Tests/Volo/Abp/BackgroundJobs/EntityFrameworkCore/AbpBackgroundJobsEntityFrameworkCoreTestModule.cs
@@ -31,7 +31,7 @@ public class AbpBackgroundJobsEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new BackgroundJobsDbContext(
diff --git a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests/EntityFrameworkCore/BlobStoringDatabaseEntityFrameworkCoreTestModule.cs b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests/EntityFrameworkCore/BlobStoringDatabaseEntityFrameworkCoreTestModule.cs
index 082b1640b7..038ca5874d 100644
--- a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests/EntityFrameworkCore/BlobStoringDatabaseEntityFrameworkCoreTestModule.cs
+++ b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests/EntityFrameworkCore/BlobStoringDatabaseEntityFrameworkCoreTestModule.cs
@@ -2,6 +2,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage;
+using Volo.Abp.EntityFrameworkCore.Sqlite;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
@@ -9,7 +10,8 @@ namespace Volo.Abp.BlobStoring.Database.EntityFrameworkCore;
[DependsOn(
typeof(BlobStoringDatabaseTestBaseModule),
- typeof(BlobStoringDatabaseEntityFrameworkCoreModule)
+ typeof(BlobStoringDatabaseEntityFrameworkCoreModule),
+ typeof(AbpEntityFrameworkCoreSqliteModule)
)]
public class BlobStoringDatabaseEntityFrameworkCoreTestModule : AbpModule
{
@@ -28,7 +30,7 @@ public class BlobStoringDatabaseEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new BlobStoringDbContext(
diff --git a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests.csproj b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests.csproj
index 59db9b77df..b48e29993d 100644
--- a/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests.csproj
+++ b/modules/blob-storing-database/test/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests/Volo.Abp.BlobStoring.Database.EntityFrameworkCore.Tests.csproj
@@ -11,6 +11,7 @@
+
diff --git a/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreTestModule.cs b/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreTestModule.cs
index 0a27448f6e..498e8e7ab6 100644
--- a/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreTestModule.cs
+++ b/modules/blogging/test/Volo.Blogging.EntityFrameworkCore.Tests/Volo/Blogging/EntityFrameworkCore/BloggingEntityFrameworkCoreTestModule.cs
@@ -33,7 +33,7 @@ namespace Volo.Blogging.EntityFrameworkCore
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
var options = new DbContextOptionsBuilder().UseSqlite(connection).Options;
diff --git a/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/CmsKitEntityFrameworkCoreTestModule.cs b/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/CmsKitEntityFrameworkCoreTestModule.cs
index 9b7fee252a..139e4bdce9 100644
--- a/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/CmsKitEntityFrameworkCoreTestModule.cs
+++ b/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/CmsKitEntityFrameworkCoreTestModule.cs
@@ -30,7 +30,7 @@ public class CmsKitEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new CmsKitDbContext(
diff --git a/modules/docs/test/Volo.Docs.EntityFrameworkCore.Tests/Volo/Docs/EntityFrameworkCore/DocsEntityFrameworkCoreTestModule.cs b/modules/docs/test/Volo.Docs.EntityFrameworkCore.Tests/Volo/Docs/EntityFrameworkCore/DocsEntityFrameworkCoreTestModule.cs
index eb3a5ae5bd..fe3e32291f 100644
--- a/modules/docs/test/Volo.Docs.EntityFrameworkCore.Tests/Volo/Docs/EntityFrameworkCore/DocsEntityFrameworkCoreTestModule.cs
+++ b/modules/docs/test/Volo.Docs.EntityFrameworkCore.Tests/Volo/Docs/EntityFrameworkCore/DocsEntityFrameworkCoreTestModule.cs
@@ -30,7 +30,7 @@ namespace Volo.Docs.EntityFrameworkCore
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new DocsDbContext(
diff --git a/modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo/Abp/FeatureManagement/EntityFrameworkCore/AbpFeatureManagementEntityFrameworkCoreTestModule.cs b/modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo/Abp/FeatureManagement/EntityFrameworkCore/AbpFeatureManagementEntityFrameworkCoreTestModule.cs
index 3329f1dba6..242cf75233 100644
--- a/modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo/Abp/FeatureManagement/EntityFrameworkCore/AbpFeatureManagementEntityFrameworkCoreTestModule.cs
+++ b/modules/feature-management/test/Volo.Abp.FeatureManagement.EntityFrameworkCore.Tests/Volo/Abp/FeatureManagement/EntityFrameworkCore/AbpFeatureManagementEntityFrameworkCoreTestModule.cs
@@ -36,7 +36,7 @@ public class AbpFeatureManagementEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new FeatureManagementDbContext(
diff --git a/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreTestModule.cs b/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreTestModule.cs
index beb2797ea9..f0d1966bd0 100644
--- a/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreTestModule.cs
+++ b/modules/identity/test/Volo.Abp.Identity.EntityFrameworkCore.Tests/Volo/Abp/Identity/EntityFrameworkCore/AbpIdentityEntityFrameworkCoreTestModule.cs
@@ -35,7 +35,7 @@ public class AbpIdentityEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new IdentityDbContext(
diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs
index 6e934d1d8c..e6711fc180 100644
--- a/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs
+++ b/modules/identityserver/test/Volo.Abp.IdentityServer.EntityFrameworkCore.Tests/Volo/Abp/IdentityServer/AbpIdentityServerTestEntityFrameworkCoreModule.cs
@@ -40,7 +40,7 @@ public class AbpIdentityServerTestEntityFrameworkCoreModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new IdentityDbContext(
diff --git a/modules/openiddict/test/Volo.Abp.OpenIddict.EntityFrameworkCore.Tests/Volo/Abp/OpenIddict/EntityFrameworkCore/OpenIddictEntityFrameworkCoreTestModule.cs b/modules/openiddict/test/Volo.Abp.OpenIddict.EntityFrameworkCore.Tests/Volo/Abp/OpenIddict/EntityFrameworkCore/OpenIddictEntityFrameworkCoreTestModule.cs
index b7bf216098..c47ecc7996 100644
--- a/modules/openiddict/test/Volo.Abp.OpenIddict.EntityFrameworkCore.Tests/Volo/Abp/OpenIddict/EntityFrameworkCore/OpenIddictEntityFrameworkCoreTestModule.cs
+++ b/modules/openiddict/test/Volo.Abp.OpenIddict.EntityFrameworkCore.Tests/Volo/Abp/OpenIddict/EntityFrameworkCore/OpenIddictEntityFrameworkCoreTestModule.cs
@@ -37,7 +37,7 @@ public class OpenIddictEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new IdentityDbContext(
diff --git a/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreTestModule.cs b/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreTestModule.cs
index 9a2c51853e..58df348af7 100644
--- a/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreTestModule.cs
+++ b/modules/setting-management/test/Volo.Abp.SettingManagement.EntityFrameworkCore.Tests/Volo/Abp/SettingManagement/EntityFrameworkCore/AbpSettingManagementEntityFrameworkCoreTestModule.cs
@@ -33,7 +33,7 @@ public class AbpSettingManagementEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new SettingManagementDbContext(
diff --git a/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreTestModule.cs b/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreTestModule.cs
index 9358a42216..336fbb228f 100644
--- a/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreTestModule.cs
+++ b/modules/tenant-management/test/Volo.Abp.TenantManagement.EntityFrameworkCore.Tests/Volo/Abp/TenantManagement/EntityFrameworkCore/AbpTenantManagementEntityFrameworkCoreTestModule.cs
@@ -37,7 +37,7 @@ public class AbpTenantManagementEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new TenantManagementDbContext(
diff --git a/npm/ng-packs/packages/oauth/src/lib/services/remember-me.service.ts b/npm/ng-packs/packages/oauth/src/lib/services/remember-me.service.ts
index 84d40d982a..ed938c5107 100644
--- a/npm/ng-packs/packages/oauth/src/lib/services/remember-me.service.ts
+++ b/npm/ng-packs/packages/oauth/src/lib/services/remember-me.service.ts
@@ -17,7 +17,7 @@ export class RememberMeService {
}
get() {
- return Boolean(JSON.parse(this.localStorageService.getItem(this.#rememberMe)));
+ return Boolean(JSON.parse(this.localStorageService.getItem(this.#rememberMe) || 'false'));
}
getFromToken(accessToken: string) {
diff --git a/npm/ng-packs/packages/oauth/src/lib/tests/remember-me.service.spec.ts b/npm/ng-packs/packages/oauth/src/lib/tests/remember-me.service.spec.ts
new file mode 100644
index 0000000000..0ef7116e92
--- /dev/null
+++ b/npm/ng-packs/packages/oauth/src/lib/tests/remember-me.service.spec.ts
@@ -0,0 +1,71 @@
+import { SpectatorService, SpyObject, createServiceFactory } from "@ngneat/spectator/jest";
+import { RememberMeService } from "../services/remember-me.service";
+import { AbpLocalStorageService } from "@abp/ng.core";
+
+
+
+describe('RememberMeService', () => {
+ const key = 'remember_me';
+ let spectator: SpectatorService;
+ let rememberMeService: RememberMeService;
+ let abpLocalStorageService: SpyObject;
+
+ const createService = createServiceFactory({
+ service: RememberMeService,
+ mocks: [AbpLocalStorageService]
+ });
+
+
+ beforeEach(() => {
+ spectator = createService();
+ rememberMeService = spectator.inject(RememberMeService);
+ abpLocalStorageService = spectator.inject(AbpLocalStorageService);
+ });
+
+ it('should be created', () => {
+ expect(1).toBe(1);
+ expect(rememberMeService).toBeTruthy();
+ expect(abpLocalStorageService).toBeTruthy();
+ });
+
+ it('should set remember me', () => {
+ rememberMeService.set(true);
+ expect(abpLocalStorageService.setItem).toHaveBeenCalledWith(key, 'true');
+ expect(abpLocalStorageService.setItem).toHaveBeenCalledTimes(1);
+ });
+
+ it('should remove remember me', () => {
+ rememberMeService.remove();
+ expect(abpLocalStorageService.removeItem).toHaveBeenCalledWith(key);
+ expect(abpLocalStorageService.removeItem).toBeCalledTimes(1);
+ });
+
+ it('if notting has ben setted, it should return false value', () => {
+ expect(rememberMeService.get()).toBe(false);
+ });
+
+ it('should return true value', () => {
+ abpLocalStorageService.getItem.mockReturnValueOnce('true');
+ expect(rememberMeService.get()).toBe(true);
+ });
+
+ it('should return false value', () => {
+ abpLocalStorageService.getItem.mockReturnValueOnce('false');
+ expect(rememberMeService.get()).toBe(false);
+ });
+
+ it('should return true when parsed token is setted to true', () => {
+ const data = { "remember_me": "True" };
+ const base64_encoded = btoa(JSON.stringify(data));
+ const tokenWithValueTrue = "random." + base64_encoded + ".random";
+ expect(rememberMeService.getFromToken(tokenWithValueTrue)).toBe(true);
+ });
+
+ it('should return false when value is not setted(undefined)', () => {
+ const data = {};
+ const base64_encoded = btoa(JSON.stringify(data));
+ const tokenWithValueTrue = "random." + base64_encoded + ".random";
+ expect(rememberMeService.getFromToken(tokenWithValueTrue)).toBe(false);
+ });
+
+});
\ No newline at end of file
diff --git a/npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts b/npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts
index db468c4a6d..e2904e33f1 100644
--- a/npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts
+++ b/npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts
@@ -7,6 +7,7 @@ import { LoaderBarComponent } from '../components/loader-bar/loader-bar.componen
describe('LoaderBarComponent', () => {
let spectator: Spectator;
+ let router: Router;
const events$ = new Subject();
const createComponent = createComponentFactory({
diff --git a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
index 1804d8cff7..b316391b5f 100644
--- a/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
+++ b/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
@@ -59,7 +59,7 @@ public class MyProjectNameEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
var options = new DbContextOptionsBuilder()
diff --git a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
index 7abdfb25f8..aed68ef88c 100644
--- a/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
+++ b/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs
@@ -33,7 +33,7 @@ public class MyProjectNameEntityFrameworkCoreTestModule : AbpModule
private static SqliteConnection CreateDatabaseAndGetConnection()
{
- var connection = new SqliteConnection("Data Source=:memory:");
+ var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
connection.Open();
new MyProjectNameDbContext(