40 lines
1.5 KiB
C#
40 lines
1.5 KiB
C#
using Church.Net.DAL.EF;
|
|
using Church.Net.DAL.EFCoreDBF;
|
|
using Church.Net.Entity;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using WebAPI.Logics;
|
|
using WebAPI.Logics.Core;
|
|
using WebAPI.Logics.Interface;
|
|
using WebAPI.Services;
|
|
using WebAPI.Services.AutoReplyCommands;
|
|
using WebAPI.Services.Interfaces;
|
|
|
|
namespace TestProject
|
|
{
|
|
public class TestBase
|
|
{
|
|
public virtual void Setup()
|
|
{
|
|
|
|
var services = new ServiceCollection();
|
|
services.AddDbContext<ChurchNetContext>(options =>
|
|
options.UseNpgsql(
|
|
//Configuration.GetConnectionString()
|
|
"Host=192.168.86.131;Port=49154;Database=Church;Username=chris;Password=1124"
|
|
));
|
|
|
|
services.AddTransient<LineAutoBotService>();
|
|
services.AddTransient<IAutoReplyCommand, ArChurchInfo>();
|
|
services.AddTransient<IAutoReplyCommand, ArArkCellGroupInfo>();
|
|
services.AddTransient<IAutoReplyCommand, ArArkCellGroupDinner>();
|
|
services.AddSingleton<VideoDownloadLogic>();
|
|
services.AddSingleton<LogicService>();
|
|
services.AddScoped(typeof(ICrudLogic<>), typeof(LogicBase<>));
|
|
services.AddScoped(typeof(ICrudDAL<>), typeof(CrudDALCBase<>));
|
|
services.AddScoped(typeof(ICombinedKeyCrudLogic<>), typeof(CombinedKeyLogicBase<>));
|
|
serviceProvider = services.BuildServiceProvider();
|
|
}
|
|
protected ServiceProvider serviceProvider { get; set; }
|
|
}
|
|
} |