2018-03-28 22:08:49 +00:00
|
|
|
|
using BotSharp.Core.Engines;
|
2017-12-30 20:26:35 +00:00
|
|
|
|
using EntityFrameworkCore.BootKit;
|
|
|
|
|
|
using Microsoft.Data.Sqlite;
|
2018-03-19 02:07:36 +00:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
2017-12-30 20:26:35 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.IO;
|
2018-03-19 02:07:36 +00:00
|
|
|
|
using System.Linq;
|
2017-12-30 20:26:35 +00:00
|
|
|
|
|
2018-03-28 22:08:49 +00:00
|
|
|
|
namespace BotSharp.UnitTest
|
2017-12-30 20:26:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
public abstract class TestEssential
|
|
|
|
|
|
{
|
2018-04-30 03:09:32 +00:00
|
|
|
|
public static String BOT_ID = "fd9f1b29-fed8-4c68-8fda-69ab463da126";
|
2018-03-28 22:08:49 +00:00
|
|
|
|
public static String BOT_CLIENT_TOKEN = "23a53c46d6244840bbb10c89c171d299";
|
|
|
|
|
|
public static String BOT_DEVELOPER_TOKEN = "d86103f446d049ff8d5f506e8dfe5f3f";
|
2018-06-11 19:48:25 +00:00
|
|
|
|
public static String BOT_NAME = "Voicebot";
|
2018-03-28 22:08:49 +00:00
|
|
|
|
|
2017-12-30 20:26:35 +00:00
|
|
|
|
protected Database dc { get; set; }
|
2018-03-19 02:07:36 +00:00
|
|
|
|
protected string contentRoot;
|
2017-12-30 20:26:35 +00:00
|
|
|
|
|
|
|
|
|
|
public TestEssential()
|
|
|
|
|
|
{
|
2018-04-30 03:09:32 +00:00
|
|
|
|
contentRoot = $"{Directory.GetCurrentDirectory()}\\..\\..\\..\\";
|
2018-03-19 02:07:36 +00:00
|
|
|
|
|
|
|
|
|
|
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
|
2018-04-07 17:14:12 +00:00
|
|
|
|
var settings = Directory.GetFiles(contentRoot + "/Settings/", "*.json");
|
2018-03-19 02:07:36 +00:00
|
|
|
|
settings.ToList().ForEach(setting =>
|
|
|
|
|
|
{
|
|
|
|
|
|
configurationBuilder.AddJsonFile(setting, optional: false, reloadOnChange: true);
|
|
|
|
|
|
});
|
|
|
|
|
|
Database.Configuration = configurationBuilder.Build();
|
|
|
|
|
|
|
2018-03-28 22:08:49 +00:00
|
|
|
|
Database.Assemblies = new String[] { "BotSharp.Core" };
|
2018-03-19 02:07:36 +00:00
|
|
|
|
Database.ContentRootPath = contentRoot;
|
|
|
|
|
|
|
|
|
|
|
|
dc = new DefaultDataContextLoader().GetDefaultDc();
|
2017-12-30 20:26:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|