Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AbpUnitTestSqliteConnection for unit test. #19125

Merged
merged 5 commits into from
Feb 26, 2024

Conversation

maliming
Copy link
Member

@maliming maliming commented Feb 23, 2024

Resolve #19065

private static SqliteConnection CreateDatabaseAndGetConnection()
{
    var connection = new AbpUnitTestSqliteConnection("Data Source=:memory:");
    connection.Open();

    var options = new DbContextOptionsBuilder<MyProjectNameDbContext>()
        .UseSqlite(connection)
        .Options;

    using (var context = new MyProjectNameDbContext(options))
    {
        context.GetService<IRelationalDatabaseCreator>().CreateTables();
    }

    return connection;
}

Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 97.22222% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 51.62%. Comparing base (ce1235a) to head (c4cf58f).
Report is 43 commits behind head on dev.

Files Patch % Lines
...lobStoringDatabaseEntityFrameworkCoreTestModule.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #19125      +/-   ##
==========================================
+ Coverage   51.61%   51.62%   +0.01%     
==========================================
  Files        3095     3096       +1     
  Lines       98240    98265      +25     
  Branches     7853     7851       -2     
==========================================
+ Hits        50703    50731      +28     
  Misses      45976    45976              
+ Partials     1561     1558       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EngincanV EngincanV merged commit 10a08a9 into dev Feb 26, 2024
5 checks passed
@EngincanV EngincanV deleted the AbpUnitTestSqliteConnection branch February 26, 2024 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test (with sqlite db) randomly fails
2 participants