You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

139 lines
4.6 KiB

using CounsellorBL;
using CounsellorBL.GROUP.ConstDefinition;
using OT.COM.ArsenalDB;
using OT.COM.ArsenalDB.SQL;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using Xunit;
namespace XUnitTestProject
{
public class DBExportTest : DBService
{
readonly List<object> asOrigetkGroupName = new List<object>() { "測試團購", "TEST" };
readonly List<object> asHoName = new List<object>() { "新北購好康" };
readonly List<object> asWangName = new List<object>() { "省八塊揪團Go (員林地區)", "王勝天揪團Go", "好棒棒揪團GO", "省好多揪團Go (台中地區)" };
readonly List<object> asLinName = new List<object>() { "海線購好康揪團GO", "鳳山購好康揪團Go", "購好康揪團go" };
readonly List<object> asTestNameCur = new List<object>() { "海線購好康揪團GO", "鳳山購好康揪團Go", "購好康揪團go" };
public override string MainTable => throw new NotImplementedException();
private SQLLib _GetSQLLib() => new SQLLib(new MSSQLDirectSQLHelper());
private long _GetCountValue(Command i_cInput)
{
_GetCount(i_cInput, out long o_lCount);
return o_lCount;
}
private string _GetCount(Command i_cInput, out long o_lCount)
{
string sMsg = null;
long lCountTemp = -1;
try
{
do
{
ArsenalInterface ai = ArsenalDBMgr.GetInst(i_cInput);
if (ai == null)
{
sMsg = "Cannot create ArsenalInterface.";
break;
}
QueryDataSet qds = ai.RunQueryDataSet(i_cInput);
if (!qds.IsSuccess)
{
sMsg = i_cInput.LastErrorMsg;
break;
}
lCountTemp = qds.Total;
}
while (false);
}
catch (Exception ex)
{
sMsg = ex.Message;
}
o_lCount = lCountTemp;
System.Diagnostics.Debug.WriteLine($"Count = {lCountTemp}");
return sMsg;
}
//[Theory]
// [InlineData("Gen_tb_ord_purchase_detail")]
//// [InlineData("Gen2_tb_ord_incoming_return_record")]
//[InlineData("Gen_tb_ord_incoming_return_record")]
//[InlineData("Gen_tb_ord_checkout_list_master")]
//[InlineData("Gen_tb_ord_checkout_list_detail")]
//[InlineData("Gen_tb_ord_order_master")]
//[InlineData("Gen_tb_ord_order_detail")]
//[InlineData("Gen_tb_hr_employee2branch")]
//[InlineData("Gen_tb_meb_member")]
//[InlineData("Gen_tb_grp_branch")]
//[InlineData("Gen_tb_grp_article")]
//[InlineData("GenFBIDsSQLByGroupName")]
//[InlineData("Gen_tb_grp_group")]
//[InlineData("Gen_tb_meb_shopping_points_record")]
//[InlineData("Gen_tb_grp_comment")]
//[InlineData("Gen_tb_prd_article2product")]
//[InlineData("Gen_tb_ord_purchase")]
//[InlineData("Gen_tb_grp_article_media")]
//[InlineData("Gen_tb_sys_uploadlog")]
//[InlineData("Gen_tb_prd_product")]
//[InlineData("Gen_tb_hr_employee")]
//[InlineData("Gen_tb_ord_message_log")]
//[InlineData("Gen_tb_ord_message_log_record")]
//[InlineData("Gen_tb_grp_group2user")]
//[InlineData("Gen_tb_sys_user")]
//[InlineData("Gen_tb_sys_user2entercode")]
//[InlineData("Gen_tb_sys_role")]
//[InlineData("Gen_tb_sys_role2org")]
//[InlineData("Gen_tb_sys_user2role")]
//public void Count(string i_sFunctionName)
//{
// string sMsg = null;
// long lCount = -1;
// do
// {
// SQLLib sl = _GetSQLLib();
// sMsg = sl.GetUIDs(SQLLib.Action.SELECT_ALL, i_sFunctionName, asTestNameCur, out Command cRead);
// if (sMsg != null)
// {
// break;
// }
// sMsg = _GetCount(cRead, out lCount);
// if (sMsg != null)
// {
// break;
// }
// if (lCount < 0)
// {
// sMsg = "Cannot be nagtive!";
// break;
// }
// }
// while (false);
// Assert.True(sMsg == null && lCount > 0, sMsg);
//}
}
}