fix ef Test
continuous-integration/drone/push Build is passing Details

pull/29/head
Corentin R 2 years ago
parent 70c7696a6c
commit 1aca79ec28

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -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<LoLDBContextWithStub>();
var app = builder.Build();
using (var scope = app.Services.CreateScope())
{
var context = scope.ServiceProvider.GetService<LoLDBContextWithStub>();
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);
}
}
}

Loading…
Cancel
Save