From 38360319d18354c2299d23161dfb8d398f62bf00 Mon Sep 17 00:00:00 2001 From: 李金换 <lijinhuan@prec-tech.com> Date: 星期四, 17 三月 2022 17:30:17 +0800 Subject: [PATCH] 【委托】【phase5上线课题131】-增加明细的时长字段“提交申请到备品出库时长” --- force-app/main/default/classes/RentalFixtureSetAssignAgencyCtrlTest.cls | 52 +++++++++++++++++++++++++++------------------------- 1 files changed, 27 insertions(+), 25 deletions(-) diff --git a/force-app/main/default/classes/RentalFixtureSetAssignAgencyCtrlTest.cls b/force-app/main/default/classes/RentalFixtureSetAssignAgencyCtrlTest.cls index 78fe783..ea96b1d 100644 --- a/force-app/main/default/classes/RentalFixtureSetAssignAgencyCtrlTest.cls +++ b/force-app/main/default/classes/RentalFixtureSetAssignAgencyCtrlTest.cls @@ -2,6 +2,13 @@ private class RentalFixtureSetAssignAgencyCtrlTest { private static User u; static void setupTestData(Boolean hasAnother) { + // 20220316 ljh add start + // 濂ユ灄宸存柉鏃ュ巻 + OlympusCalendar__c oc = new OlympusCalendar__c(); + oc.Date__c = System.Today(); + oc.Before_1_WorkDay__c = oc.Date__c.addDays(-1); + insert oc; + // 20220316 ljh add end System.runAs(new User(Id = Userinfo.getUserId())) { StaticParameter.EscapeNFM001AgencyContractTrigger = true; StaticParameter.EscapeNFM001Trigger = true; @@ -72,9 +79,10 @@ insert dep; // 浜у搧 + // 20220317 ljh Fixture_Model_No__c鍜岄厤濂楃殑 涓讳綋澶囧搧閰嶅鏄庣粏鍨嬪彿搴旇涓�鑷� Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI', - Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing', - Fixture_Model_No_T__c = 'n01', Asset_Model_No__c = 'Pro1', + Fixture_Model_No__c='modelNo1',Serial_Lot_No__c='S/N tracing', + Fixture_Model_No_T__c = 'modelNo1', Asset_Model_No__c = 'Pro1', ProductCode_Ext__c='pc01',Manual_Entry__c=false); Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI', Fixture_Model_No__c='n02',Serial_Lot_No__c='Lot tracing', @@ -89,8 +97,8 @@ //20210524 ljh add 1829 start // 浜у搧 Product2 pro10 = new Product2(Name='name010',IsActive=true,Family='GI', - Fixture_Model_No__c='n010',Serial_Lot_No__c='S/N tracing', - Fixture_Model_No_T__c = 'n010', Asset_Model_No__c = 'Pro10', + Fixture_Model_No__c='modelNo10',Serial_Lot_No__c='S/N tracing', + Fixture_Model_No_T__c = 'modelNo10', Asset_Model_No__c = 'Pro10', ProductCode_Ext__c='pc010',Manual_Entry__c=false); Product2 pro20 = new Product2(Name='name020',IsActive=true,Family='GI', Fixture_Model_No__c='n020',Serial_Lot_No__c='Lot tracing', @@ -523,6 +531,7 @@ // 鐢宠鍗曞彉涓哄凡鎵瑰噯 raObj.Status__c = '宸叉壒鍑�'; + raObj.Request_approval_time__c = Datetime.now().addDays(-1);// 20220317 ljh add 瀹℃壒鏃堕棿 update raObj; } @@ -632,7 +641,7 @@ controller.init(); // 绗竴娆″垎閰� controller.esdList[0].checked = true; - controller.parentObj.Asset_loaner_start_day__c = Date.today()+1;//20210513 ljh update + controller.parentObj.Asset_loaner_start_day__c = Date.today().addDays(1);//20210513 ljh update controller.applyDate(); controller.stepName = '鍒嗛厤'; @@ -644,7 +653,7 @@ // controller.esdList[0].checked = true; // controller.stockDown();// 20210624 ljh update SFDC-C448GR - ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id); + /*ref = new PageReference('/apex/RentalFixtureSetAssignAgency?pt_recid=' + esList[0].Id); Test.setCurrentPage(ref); controller = new RentalFixtureSetAssignAgencyController(); // 涓嬫灦鍚庨噸鏂板垎閰� @@ -653,7 +662,7 @@ controller.esdList[0].checked = true; controller.qrcode = '51110001;2;'+controller.esdList[0].rec.Rental_Apply_Equipment_Set__c; controller.scanAndMatch(); - controller.assign(); + controller.assign();*/ Test.stopTest(); @@ -745,7 +754,8 @@ } - @isTest + // 20220317 ljh 鎺у埗蹇呴』濉紝鍐欏湪鍓嶇浜嗘墍浠ヨ繖涓笉闇�瑕佷簡 + /*@isTest public static void test_cancelSet_error() { setupTestData(false); @@ -762,10 +772,9 @@ Test.stopTest(); List<Apexpages.message> msgs = ApexPages.getMessages(); - //System.assertEquals('鍙栨秷鐞嗙敱鍜屽彇娑堢悊鐢卞娉ㄤ笉鍙负绌猴紒', msgs[0].getDetail()); - //System.debug('init Error'); - - } + System.assertEquals('鍙栨秷鐞嗙敱鍜屽彇娑堢悊鐢卞娉ㄤ笉鍙负绌猴紒', msgs[0].getDetail()); + System.debug('init Error'); + }*/ @isTest public static void test_shipment() { @@ -801,12 +810,10 @@ controller.parentObj.Delivery_Agency__c = '鍖椾含甯�'; controller.shipment(); Test.stopTest(); - //System.assertEquals(true, controller.done_flg); - - //List<Apexpages.message> msgs = ApexPages.getMessages(); - //System.assertEquals('蹇呴』濉啓銆愮墿娴佸叕鍙搞��', msgs[0].getDetail()); - //System.debug('init Error'); - + System.assertEquals(true, controller.done_flg); + // 20220317 ljh add 楠岃瘉鏁版嵁浣跨敤 start + // List<Apexpages.message> msgs = ApexPages.getMessages(); + // System.assertEquals('test', msgs[0].getDetail()); } @isTest @@ -841,8 +848,8 @@ Test.stopTest(); List<Apexpages.message> msgs = ApexPages.getMessages(); - //System.assertEquals('n01鏈垎閰嶄笉鍙彂璐э紒', msgs[0].getDetail()); - System.debug('init Success'); + System.assertEquals('鍙戣揣-鍔炰簨澶勪负绌�,涓嶈兘鍙戣揣', msgs[0].getDetail()); + System.debug('init Error'); } @@ -882,9 +889,4 @@ System.debug('init Success'); } - /** - static testMethod void updaue() { - RentalFixtureSetAssignAgencyController.test();//鍏堣皟鐢ㄨ繖涓紝鐒跺悗缁х画琛ュ厖娴嬭瘯绫� - } - **/ } \ No newline at end of file -- Gitblit v1.9.1