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-06-18 14:15:54 +00:00
|
|
|
|
public static String BOT_ID = "6a9fd374-c43d-447a-97f2-f37540d0c725";
|
|
|
|
|
|
public static String BOT_CLIENT_TOKEN = "43a0f48e3f1e41da822092e7e699426b";
|
|
|
|
|
|
public static String BOT_DEVELOPER_TOKEN = "cd1e4685c6a04d7db1f59e6853fd597b";
|
|
|
|
|
|
public static String BOT_NAME = "Spotify";
|
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
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|