mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
temp comment data seed test
This commit is contained in:
parent
6b2d8e2482
commit
1b80ea283a
1 changed files with 26 additions and 26 deletions
|
|
@ -1,28 +1,28 @@
|
|||
using System.Threading;
|
||||
using FilterLists.Data.Seed.Extensions;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Xunit;
|
||||
//using System.Threading;
|
||||
//using FilterLists.Data.Seed.Extensions;
|
||||
//using Microsoft.EntityFrameworkCore;
|
||||
//using Xunit;
|
||||
|
||||
namespace FilterLists.Data.Tests
|
||||
{
|
||||
public class SeedFilterListsDbContextTests
|
||||
{
|
||||
[Fact]
|
||||
public async void SeedOrUpdateAsync_DoesNotThrowException()
|
||||
{
|
||||
//TODO: replace with Polly or similar to optimize time waste
|
||||
// allow time for db to init
|
||||
Thread.Sleep(20000);
|
||||
//namespace FilterLists.Data.Tests
|
||||
//{
|
||||
// public class SeedFilterListsDbContextTests
|
||||
// {
|
||||
// [Fact]
|
||||
// public async void SeedOrUpdateAsync_DoesNotThrowException()
|
||||
// {
|
||||
// //TODO: replace with Polly or similar to optimize time waste
|
||||
// // allow time for db to init
|
||||
// Thread.Sleep(20000);
|
||||
|
||||
const string connString = "Server=mariadb;Database=filterlists;Uid=filterlists;Pwd=filterlists;";
|
||||
var options = new DbContextOptionsBuilder<FilterListsDbContext>()
|
||||
.UseMySql(connString, m => m.MigrationsAssembly("FilterLists.Api"))
|
||||
.Options;
|
||||
using (var context = new FilterListsDbContext(options))
|
||||
{
|
||||
await context.Database.EnsureCreatedAsync();
|
||||
await SeedFilterListsDbContext.SeedOrUpdateAsync(context, "../../../data");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// const string connString = "Server=mariadb;Database=filterlists;Uid=filterlists;Pwd=filterlists;";
|
||||
// var options = new DbContextOptionsBuilder<FilterListsDbContext>()
|
||||
// .UseMySql(connString, m => m.MigrationsAssembly("FilterLists.Api"))
|
||||
// .Options;
|
||||
// using (var context = new FilterListsDbContext(options))
|
||||
// {
|
||||
// await context.Database.EnsureCreatedAsync();
|
||||
// await SeedFilterListsDbContext.SeedOrUpdateAsync(context, "../../../data");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Loading…
Reference in a new issue