public void Test_QryAccount_POCO_Context_and_Reader() // assumes that 10 records exist with extra info data { QryAccountContext context = new QryAccountContext(); Options opt = OdbcOptions.GetOptions("DSN=LOCALDELTATEST"); context.init(opt); for (int i = 0; i < 10; i++) { QryAccount tmp = context._Records.Skip(i).FirstOrDefault(); Assert.IsFalse(0 == tmp.AUnique); Assert.AreNotEqual(string.Empty, tmp.BankInfo.Trim()); } }
private static IEnumerable <QryAccount> GetXRefFromSupplierRecords(IConfiguration config) { // A: Get XRef from Account for AUnique,BankInfo pairs QryAccountContext context = new QryAccountContext(); Options opt = OdbcOptions.GetOptions(config["System5DSN"]); context.init(opt); Func <QryAccount, QryAccount> clean = (acct) => { acct.AName = acct.AName.TrimEnd(); acct.BankInfo = acct.BankInfo.TrimEnd(); return(acct); }; IEnumerable <QryAccount> records = context._Records.Select(r => clean(r)); return(records); }
private static IEnumerable <IS5InvAssembled> GetDataFromSystemFive(IConfiguration config) { string DSN = config["System5DSN"]; Options opt = OdbcOptions.GetOptions(DSN); OdbcContext_S5Inventory context = new OdbcContext_S5Inventory(opt); // Assemble Inventory S5Inventory InvRaw = new S5Inventory ( AltSuply_Records: context.AltSuplies , Comments_Records: context.CommentsLines , Inventry_27_Records: context.Inventry_27s , InvPrice_Records: context.InvPrices , Stok_Records: context.StokLines ); IEnumerable <IS5InvAssembled> InvAss = InvRaw.ToAssembled(); return(InvAss); }
public void IntegrationTest_Get_XRef_from_Supplier_Account_For_Aunique_BankInfo_Pairs() // convert to unit test { // A: Get XRef from Account for AUnique,BankInfo pairs QryAccountContext context = new QryAccountContext(); Options opt = OdbcOptions.GetOptions("DSN=LOCALDELTATEST"); context.init(opt); Func <QryAccount, QryAccount> clean = (acct) => { acct.AName = acct.AName.TrimEnd(); acct.BankInfo = acct.BankInfo.TrimEnd(); return(acct); }; IEnumerable <QryAccount> records = context._Records.Select(r => clean(r)); for (int i = 0; i < 10; i++) { QryAccount tmp = context._Records.Skip(i).FirstOrDefault(); Assert.IsFalse(0 == tmp.AUnique); Assert.AreNotEqual(string.Empty, tmp.BankInfo.TrimEnd()); } }
public static void TestOdbc() //Func<string, OdbcOptions> funcOptions { Options opt = OdbcOptions.GetOptions("DSN=LOCALDELTATEST"); OdbcContext_S5Inventory context = new OdbcContext_S5Inventory(opt); }