diff --git a/Sources/API_LoL/champion.db b/Sources/API_LoL/champion.db index 9b9ff13..cfdeed2 100644 Binary files a/Sources/API_LoL/champion.db and b/Sources/API_LoL/champion.db differ diff --git a/Sources/API_LoL/champion.db-shm b/Sources/API_LoL/champion.db-shm deleted file mode 100644 index 679fed4..0000000 Binary files a/Sources/API_LoL/champion.db-shm and /dev/null differ diff --git a/Sources/API_LoL/champion.db-wal b/Sources/API_LoL/champion.db-wal deleted file mode 100644 index 82f57bb..0000000 Binary files a/Sources/API_LoL/champion.db-wal and /dev/null differ diff --git a/Sources/EF_UT/EFDataManagerChampionTest.cs b/Sources/EF_UT/EFDataManagerChampionTest.cs index 80f34af..07e3ca2 100644 --- a/Sources/EF_UT/EFDataManagerChampionTest.cs +++ b/Sources/EF_UT/EFDataManagerChampionTest.cs @@ -2,7 +2,9 @@ using EntityFramework.Manager; using FluentAssertions; using FluentAssertions.Primitives; +using Microsoft.AspNetCore.Builder; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; using Model; using System; using System.Collections.Generic; @@ -24,16 +26,28 @@ namespace EF_UT var champ = championsManager.AddItem(new Champion("test")); } - //[TestMethod] - //public async Task GetItemsByName_DefaultChamp_One() - //{ - // IDataManager dataManager = new EFDataManager(); - // IChampionsManager championsManager = dataManager.ChampionsMgr; - - // var ak = (await championsManager.GetItemsByName("A",0,1)).First(); - - // Assert.IsNotNull(ak); - // //Assert.AreEqual("Akali", ak.Name); - //} + [TestMethod] + public async Task GetItemsByName_DefaultChamp_One() + { + var builder = WebApplication.CreateBuilder(); + + builder.Services.AddDbContext(); + + var app = builder.Build(); + + using (var scope = app.Services.CreateScope()) + { + var context = scope.ServiceProvider.GetService(); + context.Database.EnsureCreated(); + } + + IDataManager dataManager = new EFDataManager(); + IChampionsManager championsManager = dataManager.ChampionsMgr; + + var ak = (await championsManager.GetItemsByName("A", 0, 1)).First(); + + Assert.IsNotNull(ak); + //Assert.AreEqual("Akali", ak.Name); + } } }