2020-10-22 14:59:36 +08:00
|
|
|
|
using System;
|
|
|
|
|
using Infrastructure;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace OpenAuth.App.Test
|
|
|
|
|
{
|
|
|
|
|
class TestDbExtension :TestBase
|
|
|
|
|
{
|
|
|
|
|
private ILog log = LogManager.GetLogger(typeof(TestDbExtension));
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestGetProperties()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var app = _autofacServiceProvider.GetService<DbExtension>();
|
|
|
|
|
|
2022-02-21 00:39:55 +08:00
|
|
|
|
var result = app.GetTableColumnsFromDb("Category");
|
2020-10-22 14:59:36 +08:00
|
|
|
|
Console.WriteLine(JsonHelper.Instance.Serialize(result));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void GetDbEntityNames()
|
|
|
|
|
{
|
|
|
|
|
var app = _autofacServiceProvider.GetService<DbExtension>();
|
|
|
|
|
|
|
|
|
|
var result = app.GetDbEntityNames();
|
|
|
|
|
Console.WriteLine(JsonHelper.Instance.Serialize(result));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestGetTables()
|
|
|
|
|
{
|
|
|
|
|
var app = _autofacServiceProvider.GetService<DbExtension>();
|
|
|
|
|
|
|
|
|
|
var result = app.GetDbTableStructure("application");
|
|
|
|
|
Console.WriteLine(JsonHelper.Instance.Serialize(result));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|