遗漏的测试点

2011-10-25  袁永云 

需求:客户做代客结汇交易时“当日期初+当日代客结汇-当日代客售汇+当日买入-当日卖出+当前代客结汇交易金额>敞口限额”则提示用户先去平盘

后台sql为:

select nvl(exposurelimit,0)-nvl(-5885793.111 + buybalance-salebalance + inbalance - outbalance,0) as validbalance
 from  (
       select sum(f.mamount)  buybalance
       from FE_TRANSFOREIGNEXCHANGE f 
       where f.nofficeid = 1
             and f.ncurrencyid = 2
             and f.ntranstypeid in(1101)
             and f.nstatusid >= 2
             and f.dtexecutedate >= to_date('2011-09-06','yyyy-mm-dd')
             and f.dtexecutedate <= to_date('2011-09-06','yyyy-mm-dd')
       )t2, 
       (select sum(f.mamount) salebalance
       from FE_TRANSFOREIGNEXCHANGE f
       where f.nofficeid = 1
             and f.ncurrencyid = 2
             and f.ntranstypeid in (1102)
             and f.nstatusid >= 2
             and f.dtexecutedate >= to_date('2011-09-06','yyyy-mm-dd')
             and f.dtexecutedate <= to_date('2011-09-06','yyyy-mm-dd')
       )t3,
       (select sum(fe.mfamount)  inbalance
       from fe_foreignbalance fe
       where fe.nofficeid  = 1
             and fe.ncurrencyid  = 2
             and fe.ndirection = 2
             and fe.nstatusid >= 2
             and fe.ntranstypeid = 1105
             and fe.dtexecutedate >= to_date('2011-09-06','yyyy-mm-dd')
             and fe.dtexecutedate <= to_date('2011-09-06','yyyy-mm-dd')
        )t4,
       (select sum(fe.mfamount) outbalance
       from fe_foreignbalance fe
       where fe.nofficeid  = 1
             and fe.ncurrencyid  = 2
             and fe.ndirection = 1
             and fe.nstatusid >= 2
             and fe.ntranstypeid = 1105
             and fe.dtexecutedate >= to_date('2011-09-06','yyyy-mm-dd')
             and fe.dtexecutedate <= to_date('2011-09-06','yyyy-mm-dd')
       )t5,
       (select fi.exposurelimit
       from fi_integratedposition fi
       where fi.ncurrencyid = 2
             and fi.nstatusid = 1
             and fi.nofficeid = 1
       )t6;
存在一个问题当nvl(-5885793.111 + buybalance-salebalance + inbalance - outbalance,0) buybalance、salebalance、inbalance 、outbalance其中一个为空时,则其他都为空。测试时应加入未发生某些交易的测试用例。
375°/3738 人阅读/2 条评论 发表评论

付民  2011-11-10

嗯.....


小窝  2011-11-16

已同步至官方微博


登录 后发表评论